Beispiel #1
0
        protected override void LoadTestData()
        {
            var resource = new AllReady.Models.Resource {
                Id = 2, Name = "ResourceName"
            };

            Context.Resources.Add(resource);

            Context.SaveChanges();
        }
        public ResourceDeleteViewModel(AllReady.Models.Resource resource)
        {
            if (resource == null)
            {
                return;
            }

            Id          = resource.Id;
            CampaignId  = resource.CampaignId;
            Name        = resource.Name;
            ResourceUrl = resource.ResourceUrl;
        }
        public ResourceDetailViewModel(AllReady.Models.Resource resource)
        {
            if (resource == null)
            {
                return;
            }

            Id           = resource.Id;
            CampaignId   = resource.CampaignId;
            CampaignName = resource.Campaign?.Name;
            Name         = resource.Name;
            Description  = resource.Description;
            ResourceUrl  = resource.ResourceUrl;
        }