public async Task <bool> Login(int clientId, int password) { Client client = await AuthService.Login(clientId, password); if (client != null) { Session session = new Session() { ClientId = client.ClientId, StartDate = DateTime.Now }; using (DataManagementProvider) { await DataManagementProvider.Upsert(client); await DataManagementProvider.Insert(session); await DataManagementProvider.SaveAsync(); } CurrentSession = session; return(true); } return(false); }
public async Task LogUserAction(string description) { var userAction = new UserAction() { SessionId = AuthProvider.CurrentSession.SessionId, Description = description, Date = DateTime.Now }; using (DataManagementProvider) { await DataManagementProvider.Insert(userAction); await DataManagementProvider.SaveAsync(); } }