Repo_User.cs

33 lines | 821 B Blame History Raw Download
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Model.Entities.Base;
using Model.UnitsOfWork;

namespace Model.Entities.Users
{
    public class Repo_User : BaseRepository<User>
    {
        public Repo_User(Context context) : base(context) { }

        protected override void Validation_Create(User elem)
        {
            if (All_NoTrack.FirstOrDefault(e => e.Login == elem.Login) != null)
                throw new Exception();                
        }

        protected override void Validation_Delete(User elem)
        {
            throw new NotImplementedException();
        }

        protected override void Validation_Update(User old, User elem)
        {
            throw new NotImplementedException();
        }
    }
}