示例#1
0
 /// <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);
 }
示例#2
0
 public void Delete(Country country)
 {
     this.Context.Entry(country).State = EntityState.Deleted;
     this.Context.SaveChanges();
 }