-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defined and added user service and user class.
- Loading branch information
1 parent
c00ef2e
commit 23e9c9c
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace CirsaHackaton.Model | ||
{ | ||
public class User | ||
{ | ||
private String id; | ||
private String name; | ||
private String email; | ||
private String password; | ||
|
||
public User(String name, String email, String password) | ||
{ | ||
id = Guid.NewGuid().ToString(); | ||
this.name = name; | ||
this.email = email; | ||
this.password = password; | ||
} | ||
|
||
//Getters | ||
public String GetId() { return id; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using CirsaHackaton.Model; | ||
|
||
namespace CirsaHackaton.Services | ||
{ | ||
public class UserService | ||
{ | ||
private List<User> dummyUsersDatabase = new List<User>(); | ||
private User? loggedUser; | ||
|
||
|
||
//Getters | ||
public List<User> GetUsers() { return dummyUsersDatabase; } | ||
public User? GetLoggedUser() { return loggedUser; } | ||
public User? GetUserById(String uid) { return dummyUsersDatabase.Find(user => user.GetId().Equals(uid)); } | ||
|
||
//Data modifiers | ||
public void AddUser(User user) { dummyUsersDatabase.Add(user); } | ||
} | ||
} |