Add LocationId field to UserLocation
This commit is contained in:
parent
486ba1872a
commit
68dbc92172
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
public async Task<UserLocation> GetUserLocation(string userId)
|
public async Task<UserLocation> GetUserLocation(string userId)
|
||||||
{
|
{
|
||||||
return await _locationsRepository.GetUserLocationAsync(id);
|
return await _locationsRepository.GetUserLocationAsync(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Locations>> GetAllLocation()
|
public async Task<List<Locations>> GetAllLocation()
|
||||||
@ -52,7 +52,7 @@
|
|||||||
var userLocation = await _locationsRepository.GetUserLocationAsync(userId);
|
var userLocation = await _locationsRepository.GetUserLocationAsync(userId);
|
||||||
userLocation = userLocation ?? new UserLocation();
|
userLocation = userLocation ?? new UserLocation();
|
||||||
userLocation.UserId = userId;
|
userLocation.UserId = userId;
|
||||||
userLocation.LocationId = currentUserAreaLocationList[0].Id;
|
userLocation.LocationId = currentUserAreaLocationList[0].LocationId;
|
||||||
userLocation.UpdateDate = DateTime.UtcNow;
|
userLocation.UpdateDate = DateTime.UtcNow;
|
||||||
await _locationsRepository.UpdateUserLocationAsync(userLocation);
|
await _locationsRepository.UpdateUserLocationAsync(userLocation);
|
||||||
|
|
||||||
|
@ -7,8 +7,10 @@
|
|||||||
|
|
||||||
public class Locations
|
public class Locations
|
||||||
{
|
{
|
||||||
|
[BsonId]
|
||||||
[BsonRepresentation(BsonType.ObjectId)]
|
[BsonRepresentation(BsonType.ObjectId)]
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
public int LocationId { get; set; }
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
[BsonRepresentation(BsonType.ObjectId)]
|
[BsonRepresentation(BsonType.ObjectId)]
|
||||||
public string Parent_Id { get; set; }
|
public string Parent_Id { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user