public ReceiptTypeModel Create(FundTrackReceiptType model)
 {
     return new ReceiptTypeModel()
     {
         Id = model.Id,
         Description = model.Description,
         Name = model.Name
     };
 }
        public static void SeedData(FundTrackContext context)
        {
            int NUMBER_OF_RECEIPTS = 600;
            int MAX_NUMBER_OF_COMMENTS = 20;

            var receiptList = new List<FundTrackReceipt>();

            var cenlarSubServicer = new FundTrackSubservicer
            {
                Name = "Cenlar",
                IsEnabled = true
            };

            var loanCareSubServicer = new FundTrackSubservicer
            {
                Name = "LoanCare",
                IsEnabled = true
            };

            var olegsSubServicer = new FundTrackSubservicer
            {
                Name = "Olegs Subservice",
                IsEnabled = false
            };

            var checkType = new FundTrackReceiptType
            {
                Name = "Check",
                Description =
                    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae scelerisque tortor. Fusce ac augue in nulla lobortis auctor fringilla id urna. Aenean eleifend metus mi, non fringilla libero tempus ac. Curabitur vitae posuere ligula, ac faucibus ex. Cras placerat est lectus, condimentum dictum est volutpat quis. Proin bibendum vel tortor sit amet lobortis. Curabitur bibendum porttitor erat vel molestie. Morbi auctor cursus nisl et posuere. Donec ac placerat mauris, quis rutrum turpis."
            };

            var wireType = new FundTrackReceiptType
            {
                Name = "Wire",
                Description =
                    "Aenean sed fringilla lectus, vitae placerat mi. Proin non ante interdum, congue metus dignissim, gravida enim. Praesent pulvinar vehicula sodales. In congue hendrerit vestibulum. Sed vitae interdum quam. Maecenas nec quam urna. Nulla sollicitudin, nisi a vulputate luctus, leo neque luctus turpis, quis ultrices mauris dui sit amet diam. Nunc imperdiet quam id lectus convallis, eget condimentum lorem consectetur. Sed dignissim bibendum ultrices. Proin in sem ac dolor vestibulum sodales a nec lacus. Praesent lectus quam, interdum a condimentum accumsan, congue in ante. Phasellus at mi euismod, mollis dui in, ornare nisl."
            };

            context.FundTrackSubservicers.Add(cenlarSubServicer);
            context.FundTrackSubservicers.Add(loanCareSubServicer);
            context.FundTrackSubservicers.Add(olegsSubServicer);
            context.FundTrackReceiptTypes.Add(checkType);
            context.FundTrackReceiptTypes.Add(wireType);

            var random = new Random();

            for (int i = 0; i < NUMBER_OF_RECEIPTS; i++)
            {
                var receipt = new FundTrackReceipt
                {
                    CheckNumber = string.Concat("Paypal:", i.ToString()),
                    ReceivedDate = new DateTime(2005, 1, 1),
                    TotalAmount = random.Next(1000000),
                    ReceiptType = i%2 == 0 ? checkType : wireType,
                    Servicer = i%3 == 0 ? cenlarSubServicer : loanCareSubServicer
                };

                if (i == 10)
                {
                    receipt.Servicer = olegsSubServicer;
                }

                receipt.Comments.AddRange(BuildCommentList(random.Next(MAX_NUMBER_OF_COMMENTS)));

                receiptList.Add(receipt);
            }

            context.FundTrackReceipts
                .AddRange(receiptList);

            context.SaveChanges();
        }