public CreateNewSchoolingEventCommand(
            Guid id,
            string title,
            string description,
            bool isPublic,
            SchoolingEventAddress location,
            ICollection <SchoolingEventDay> calendar,
            ICollection <SchoolingEventTicket> tickets,
            ICollection <SchoolingEventGalleryFile> gallery) : base(id, title, description, isPublic, location, calendar, tickets, gallery)
        {
            location.Id = Guid.Empty;

            foreach (var day in calendar)
            {
                day.Id = Guid.Empty;

                foreach (var tag in day.Tags)
                {
                    tag.Id = Guid.Empty;
                }
            }

            foreach (var ticket in tickets)
            {
                ticket.Id = Guid.Empty;
            }
        }
Exemplo n.º 2
0
 public UpdateSchoolingEventCommand(
     Guid id,
     string title,
     string description,
     bool isPublic,
     SchoolingEventAddress location,
     ICollection <SchoolingEventDay> calendar,
     ICollection <SchoolingEventTicket> tickets,
     ICollection <SchoolingEventGalleryFile> gallery) : base(id, title, description, isPublic, location, calendar, tickets, gallery)
 {
 }
Exemplo n.º 3
0
        public static void Seed(this JetAnotherEmsContext context, IHostingEnvironment hostingEnvironment, string baseUrl)
        {
            var uploadFolderPath = Path.Combine(hostingEnvironment.WebRootPath, "uploads");

            Directory.CreateDirectory(uploadFolderPath);

            Func <string, string> ftpFileUrlResolver = fileName => $"{baseUrl}/uploads/{fileName}";

            var events = new List <SchoolingEvent>()
            {
                new SchoolingEvent()
                {
                    Id          = Guid.Parse("f9d6f596-b4af-40f0-8520-6f2e124c085d"),
                    Title       = "Seed title",
                    Description = "Seed description",
                    IsPublic    = true,
                    Location    = new SchoolingEventAddress()
                    {
                        Id          = Guid.Parse("d87bce2b-29f5-438e-910f-201eac76b27b"),
                        Description = "Zygmunta Janiszewskiego 7, Wrocław",
                        Lat         = 51.109427201651876f,
                        Lng         = 17.05958488218637f
                    },
                    Schedule = new List <SchoolingEventDay>()
                    {
                        new SchoolingEventDay()
                        {
                            Title       = "Dummy title",
                            Description = "Dummy day description",
                            LectureRoom = "C3 123",
                            Teacher     = "Andrew Gol",
                            Start       = DateTime.Now,
                            End         = DateTime.Now.AddHours(1),
                            Tags        = new List <SchoolingEventDayTag>()
                            {
                                new SchoolingEventDayTag()
                                {
                                    Value       = "Angular",
                                    Description = "Web framework"
                                }
                            },
                            Attachments = new List <SchoolingEventDayAttachment>()
                            {
                                new SchoolingEventDayAttachment()
                                {
                                    Id             = Guid.Parse("9e2c7877-2fde-46f4-8efb-c7d3f85be0b1"),
                                    FileName       = "JetAnotherEMS.Infrastructure.Data.Context.SeedData.Attachment_1.pdf",
                                    LocationOnDisk = uploadFolderPath,
                                    OriginalName   = "Attachment_1.pdf",
                                    Size           = 264_000,
                                    FtpFileUrl     = $"{baseUrl}"
                                }
                            }
                        },
Exemplo n.º 4
0
 public SchoolingEventCommand(
     Guid id,
     string title,
     string description,
     bool isPublic,
     SchoolingEventAddress location,
     ICollection <SchoolingEventDay> calendar,
     ICollection <SchoolingEventTicket> tickets,
     ICollection <SchoolingEventGalleryFile> gallery)
 {
     Id          = id;
     Title       = title;
     Description = description;
     IsPublic    = isPublic;
     Location    = location;
     Calendar    = calendar;
     Tickets     = tickets;
     Gallery     = gallery;
 }