Exemplo n.º 1
0
        private static bool InsertUser(FMIContext context, string email, string password, string fn, string ln)
        {
            try
            {
                var user = new User
                {
                    LoginEmail   = email,
                    PasswordHash = password,
                    FirstName    = fn,
                    LastName     = ln,
                    Gender       = true,
                    CreationDate = DateTime.Now,
                    IsDeleted    = false
                };

                context.Users.Add(user);
                context.SaveChanges();
            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var context = new FMIContext();

            InsertUser(context, "*****@*****.**", "123456", "FirstName2", "LastName2");
            Console.WriteLine(14);
        }
Exemplo n.º 3
0
 public NewsRepo(FMIContext context)
 {
     this.context = context;
 }
Exemplo n.º 4
0
 public AwardRepo(FMIContext context)
 {
     this.context = context;
 }
Exemplo n.º 5
0
 public PublicationRepo(FMIContext context)
 {
     this.context = context;
 }
Exemplo n.º 6
0
 public SoftwareDatasetRepo(FMIContext context)
 {
     this.context = context;
 }
Exemplo n.º 7
0
 public UserRepo(FMIContext context)
 {
     this.context = context;
 }