public bool Remove(LocationEF entity) { if (entity is null) { throw new ArgumentNullException(nameof(entity)); } return(Remove(entity.Id)); }
public LocationEF Update(LocationEF Entity) { if (Entity is null) { throw new ArgumentNullException(nameof(Entity)); } return(issuesContext .Locations .Update(Entity) .Entity); }
public LocationEF Add(LocationEF Entity) { if (Entity is null) { throw new ArgumentNullException(nameof(Entity)); } var result = issuesContext.Locations.Add(Entity); issuesContext.SaveChanges(); return(result.Entity); }
public static LocationTO ToTransfertObject(this LocationEF issue) { if (issue is null) { throw new ArgumentNullException(nameof(issue)); } return(new LocationTO { LocationId = issue.LocationId, Name = issue.Name }); }
public LocationResultDto(LocationEF l) { ID = l.ID.ToString("N"); Type = l.TypeID; Country = l.CountryID; Name = l.Name; NameShort = l.NameShort; Avatar = l.Avatar; Lat = l.Latitude; Lon = l.Longitude; Rating = l.Rating; RatingCount = l.RatingCount; }
public LocationDetailDto(LocationEF l) { ID = l.ID.ToString("N"); Name = l.Name; NameShort = l.NameShort; Avatar = l.Avatar; Type = l.TypeID; Description = l.Description; CountryID = l.CountryID; Lat = l.Latitude; Lon = l.Longitude; Rating = l.Rating; RatingCount = l.RatingCount; }
public ClimbDetailDto(LocationEF loc) { LocID = loc.ID.ToString("N"); if (!string.IsNullOrWhiteSpace(loc.NameShort)) { LocName = loc.NameShort; } else { LocName = loc.Name; } //Logs = new List<ClimbDetailLoggedClimbDto>();, IEnumerable<LoggedClimb> logs //foreach (var l in logs.OrderByDescending(l => l.Utc)) { Logs.Add(new ClimbDetailLoggedClimbDto(l)); } }
private void FixupLocation(LocationEF previousValue) { if (previousValue != null && previousValue.CheckIns.Contains(this)) { previousValue.CheckIns.Remove(this); } if (Location != null) { if (!Location.CheckIns.Contains(this)) { Location.CheckIns.Add(this); } if (LocationID != Location.ID) { LocationID = Location.ID; } } }
private void FixupLocation(LocationEF previousValue) { if (previousValue != null && previousValue.LoggedClimbs.Contains(this)) { previousValue.LoggedClimbs.Remove(this); } if (Location != null) { if (!Location.LoggedClimbs.Contains(this)) { Location.LoggedClimbs.Add(this); } if (Denorm_LocationID != Location.ID) { Denorm_LocationID = Location.ID; } } }