You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

66 lines
1.6 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sevomin.Models.Repositories
{
public class UserRepository : IUserRepository
{
#region Singleton
private static UserRepository member;
private static object locker = new object();
private UserRepository()
{
}
static UserRepository()
{
lock (locker)
{
UserRepository.member = new UserRepository();
}
}
public static UserRepository Current
{
get
{
return UserRepository.member;
}
}
#endregion
public User FindWithConfirmationCode(string code)
{
return SevominDbContext.Current.Users.FirstOrDefault(u => u.ConfirmationCode == code);
}
public void Add(User entity)
{
throw new NotImplementedException();
}
public User Find(string identifier)
{
return SevominDbContext.Current.Users.FirstOrDefault(u => u.UserName.ToLower() == identifier.ToLower());
}
public void Delete(User entity)
{
throw new NotImplementedException();
}
public void Save()
{
SevominDbContext.Current.SaveChanges();
}
public IQueryable<User> ListAll()
{
return SevominDbContext.Current.Users;
}
}
}