Пример #1
0
        public static async Task PaymentTypeInitialize(IPaymentTypeRepository Repository)
        {
            var Values = new string[] { "Наличный", "Безналичный" };

            var Types = await Repository.GetAllAsync();

            foreach (var Value in Values)
            {
                if (Types.Where(i => i.Name == Value).ToList().Count == 0)
                {
                    await Repository.CreateAsync(new PaymentType { Name = Value });
                }
            }
        }