public object Create(BLL.Governor o) { var dto = _mapper.Map <BLL.Governor, Governor>(o); _db.AddToGovernors(dto); _db.SaveChanges(); return(o); }
public object Create(BLL.AssetValue o) { var dto = _mapper.Map <BLL.AssetValue, AssetValue>(o); dto.GovernorId = o.Governor.Id; //dto.Governor = _db.Governors.GetById(dto.GovernorId); _db.AddToAssets(dto); _db.SaveChanges(); return(o); }