// create new building in table buildings . public async Task <Buildings> create(Buildings entity) { var building = _repositoryBuildings.FirstOrDefault(x => x.Id == entity.Id); if (building != null) { throw new UserFriendlyException("Building is already exist"); } else { return(await _repositoryBuildings.InsertAsync(entity)); } }
public void update(Buildings entity) { _repositoryBuildings.Update(entity); }
public async Task <Buildings> updateAsync(Buildings entity) { return(await _repositoryBuildings.UpdateAsync(entity)); }