コード例 #1
0
 static void Main()
 {
     WizardDeposit dumbledore = new WizardDeposit()
     {
         FirstName             = "Albus",
         LastName              = "Dumbledore",
         Age                   = 150,
         MagicWandCreator      = "Antioch Peverell",
         MagicWandSize         = 15,
         DepositStartDate      = new DateTime(2016, 10, 20),
         DepositExpirationDate = new DateTime(2020, 10, 20),
         DepositAmount         = 20000.24m,
         DepositCharge         = 0.2m,
         IsDepositExpired      = false,
     };
     var context = new WizardDepositsContext();
 }
コード例 #2
0
        static void Main()
        {
            GringottsContext gringotts = new GringottsContext();

            try
            {
                WizardDeposit deposit = new WizardDeposit
                {
                    Wizzard = new Wizzard()
                    {
                        Age       = 150,
                        FirstName = "Peter",
                        LastName  = "Griphin"
                    },
                    Deposit = new Deposit()
                    {
                        Amount          = 100,
                        Charge          = 2.3m,
                        ExpirationDate  = new DateTime(1992, 02, 10),
                        Group           = "Orks",
                        Interest        = 34.3m,
                        StartDate       = new DateTime(1989, 10, 29),
                        IsDepositeGroup = true
                    },
                    MagicWandInfo = new MagicWand()
                    {
                        Creator = "Peter Petrelli",
                        Size    = 20
                    }
                };
                gringotts.WizardDeposits.Add(deposit);
                gringotts.SaveChanges();
            }
            catch (DbEntityValidationException ex)
            {
                foreach (DbEntityValidationResult dbEntityValidationResult in ex.EntityValidationErrors)
                {
                    foreach (DbValidationError dbValidationError in dbEntityValidationResult.ValidationErrors)
                    {
                        Console.WriteLine(dbValidationError.ErrorMessage);
                    }
                }
            }
        }
コード例 #3
0
        static void Main()
        {
            GringottsContext context = new GringottsContext();

            WizardDeposit dumbledore = new WizardDeposit
            {
                FirstName             = "Albus",
                LastName              = "Dumbledore",
                Age                   = 150,
                MagicWandCreator      = "Antioch Peverell",
                MagicWandSize         = 15,
                DepositStartDate      = new DateTime(2016, 10, 20),
                DepositExpirationDate = new DateTime(2020, 10, 20),
                DepositAmount         = 20000.24m,
                DepositCharge         = 0.2m,
                IsDepositExpires      = false,
            };

            context.WizardeDposits.Add(dumbledore);
            context.SaveChanges();
        }
コード例 #4
0
        static void Main(string[] args)
        {
            var context = new GringottsContext();

            WizardDeposit newDeposit = new WizardDeposit()
            {
                FirstName             = "Albus",
                LastName              = "Dumbledore",
                Age                   = 150,
                MagicWandCreator      = "Antioch Peverell",
                MagicWandSize         = 15,
                DepositStartDate      = new DateTime(2016, 10, 20),
                DepositExpirationDate = new DateTime(2020, 10, 20),
                DepositAmount         = 20000.24,
                DepositCharge         = 0.2,
                IsDepositExpired      = false
            };

            context.WizardDeposits.Add(newDeposit);
            context.SaveChanges();
        }
コード例 #5
0
        static void Main(string[] args)
        {
            WizartContext context = new WizartContext();
            //context.WizartDeposits.Count();

            WizardDeposit dumbledore = new WizardDeposit()
            {
                Firstname             = "Mavrus",
                Lastname              = "Desketar",
                Age                   = 250,
                MagicWandCreator      = "Ev Quartys",
                MagicWandSize         = 30,
                DepositStartDate      = new DateTime(2016, 11, 20),
                DepositExpirationDate = new DateTime(2022, 11, 20),
                DepositAmount         = 50000.24m,
                DepositCharge         = 0.3,
                IsDepositExpired      = false
            };

            context.WizartDeposits.Add(dumbledore);
            context.SaveChanges();
        }
コード例 #6
0
        static void Main(string[] args)
        {
            var context = new  GringotsContext();
            //context.Database.Initialize(true);

            WizardDeposit dumbledore = new WizardDeposit()
            {
                FirstName             = "Albus",
                LastName              = "Dumbledore",
                Age                   = 150,
                MagicWandCreator      = "Antoich Peverell",
                MagicWandSize         = 15,
                DepositStartDate      = new DateTime(2016, 10, 20),
                DepositExpirationDate = new DateTime(2020, 10, 20),
                DepositAmount         = 20000.24m,
                DepositCharge         = 0.2,
                IsDepositExpired      = false,
            };

            context.WizardDeposit.Add(dumbledore);
            context.SaveChanges();
        }
コード例 #7
0
        public static void Main()
        {
            var context = new WizardContext();
            //context.Database.Initialize(true);

            WizardDeposit wd = new WizardDeposit()
            {
                Id                    = 1,
                FirstName             = "Albus",
                LastName              = "Dumbledore",
                Age                   = 150,
                MagicWandCreator      = "Antioch Peverell",
                MagicWandSize         = 15,
                DepositStartDate      = new DateTime(2016, 10, 20),
                DepositExpirationDate = new DateTime(2020, 10, 20),
                DepositAmount         = 20000.24m,
                DepositCharge         = 0.2m,
                IsDepositExpired      = false
            };

            context.WizardDeposits.Add(wd);
            context.SaveChanges();
        }
コード例 #8
0
ファイル: GringottsApp.cs プロジェクト: stominmetal/Softuni
        public static void Main()
        {
            //            01.
            WizardDeposit wizard = new WizardDeposit();

            wizard.FirstName             = "Albus";
            wizard.LastName              = "Dumbledore";
            wizard.Age                   = 150;
            wizard.MagicWandCreator      = "Antioch Peverell";
            wizard.MagicWandSize         = 15;
            wizard.DepositStartDate      = new DateTime(2016, 10, 20);
            wizard.DepositExpirationDate = new DateTime(2020, 10, 20);
            wizard.DepositAmount         = 20000.24m;
            wizard.DepositCharge         = 0.2m;
            wizard.IsDepositExpired      = false;

            WizardContext context = new WizardContext();

            context.WizardDeposits.Add(wizard);
            context.SaveChanges();

            //02.
            User user = new User()
            {
                Username         = "******",
                Password         = "******",
                Email            = "*****@*****.**",
                ProfilePicture   = "asdfghju6543wetrsdfgfh",
                RegisteredOn     = DateTime.Now,
                LastTimeLoggedIn = DateTime.Today,
                Age       = 20,
                IsDeleted = false
            };

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