Пример #1
0
 // Insert new neighborhood to the databse 
 public async Task<Neighborhood> Create(Neighborhood entity)
 {
     var neighborhood = _IRepositoryNeighborhood.FirstOrDefault(x => x.Id == entity.Id);
     if(neighborhood!=null)
     {
         throw new UserFriendlyException("NeighborHood already Exist");
     }
     else
     {
         return await _IRepositoryNeighborhood.InsertAsync(entity);
     }
 }
Пример #2
0
        // get all neighborhoods in the table database 
        public IEnumerable<Neighborhood> getAllList()
        {

            var output = _IRepositoryNeighborhood.GetAll();
            if (output == null)
            {
                var defaultList = new Neighborhood();
                return (IEnumerable<Neighborhood>)defaultList;

            }
            else
                return output;
        }
Пример #3
0
 // update neighborhood details 
 public void Update(Neighborhood entity)
 {
     _IRepositoryNeighborhood.Update(entity);
 }