Example #1
0
 public void DeleteLocation(int userId, int locationId)
 {
     using (UserLocationRepository repo = new UserLocationRepository())
     {
         repo.Delete(userId, locationId);
     }
 }
Example #2
0
 public void DeleteUserLocation(int id)
 {
     //unitOfWork.StartTransaction();
     UserLocationRepository repo = new UserLocationRepository(unitOfWork);
     //UserLocationModel userLocationModel = new UserLocationModel();
     UserLocation userLocation = new UserLocation();
     repo.Delete(x=>x.UserLocationId==id);
     //unitOfWork.Commit();
 }
Example #3
0
        //public async Task<IHttpActionResult> DeleteLocation(Guid id)
        //{
        //    UserLocation location = _userLocationRepository.GetSingle(e => e.Id == id);
        //    if (location == null)
        //    {
        //        return NotFound();
        //    }

        //    await _userLocationRepository.DeleteAsync(location);


        //    return Ok(location);
        //}
        public IHttpActionResult DeleteLocation(Guid id)
        {
            UserLocation location = _userLocationRepository.GetSingle(e => e.Id == id);

            if (location == null)
            {
                return(NotFound());
            }

            _userLocationRepository.Delete(location);


            return(Ok(location));
        }