/// <summary> /// Convert Country Entity into Country Object /// </summary> ///<param name="model">CountryViewModel</param> ///<param name="CountryEntity">DataAccess.Country</param> ///<returns>CountryViewModel</returns> public static CountryViewModel ToViewModel( this DataAccess.Country entity, CountryViewModel model) { model.Id = entity.Id; model.Name = entity.Name; model.GlobalRegionId = entity.GlobalRegionId; model.GlobalRegion = entity.GlobalRegion.Name; model.IsActive = entity.IsActive; return(model); }
public void Delete(Country country) { this.Context.Entry(country).State = EntityState.Deleted; this.Context.SaveChanges(); }