Пример #1
0
 public Response Register(string registrationid)
 {
     var userRep = new UserRepository();
     var currentUser = userRep.AspNetUsers.FirstOrDefault(x => x.Id == GetUserId());
     if (currentUser == null)
     {
         return new InternalError("No such user");
     }
     currentUser.registrationId = registrationid;
     if (userRep.Update(currentUser))
         return Response(true);
     return new InternalError();
 }
Пример #2
0
 public Response ResetLocation()
 {
     var userRep = new UserRepository();
     var currentUser = userRep.AspNetUsers.FirstOrDefault(x => x.Id == GetUserId());
     if (currentUser == null)
     {
         return new InternalError("No such user");
     }
     currentUser.longitude = null;
     currentUser.latitude = null;
     if (userRep.Update(currentUser))
         return Response(true);
     return new InternalError();
 }