public object Create(IFormDataProvider dataProvider) { if (dataProvider == null) { throw new ArgumentNullException("dataProvider"); } return new FileModel { Name = dataProvider.GetValue("Name"), File = dataProvider.GetFile("File") }; }
public object Create(IFormDataProvider dataProvider) { if (dataProvider == null) { throw new ArgumentNullException("dataProvider"); } return(new FileModel { Name = dataProvider.GetValue("Name"), File = dataProvider.GetFile("File") }); }
public object Create(IFormDataProvider dataProvider) { if (dataProvider == null) { throw new ArgumentNullException("dataProvider"); } var result = new ExternalProjectModel { Name = dataProvider.GetValue("Name"), Description = dataProvider.GetValue("Description"), VideoUri = dataProvider.GetValue("VideoUri"), ProductName = dataProvider.GetValue("ProductName"), Avsx = dataProvider.GetFile("Avsx"), Screenshot = dataProvider.GetFile("Screenshot") }; if (dataProvider.Contains("Access")) { result.Access = dataProvider.GetValue("Access", ProjectAccess.Public); } if (dataProvider.Contains("EnableComments")) { result.EnableComments = dataProvider.GetValue("EnableComments", true); } if (dataProvider.Contains("ProjectType", true)) { result.ProjectType = dataProvider.GetValue("ProjectType", ProjectType.None); } if (dataProvider.Contains("ProjectSubtype", true)) { result.ProjectSubtype = dataProvider.GetValue("ProjectSubtype", ProjectSubtype.None); } return(result); }
public object Create(IFormDataProvider dataProvider) { if (dataProvider == null) { throw new ArgumentNullException("dataProvider"); } var result = new ExternalProjectModel { Name = dataProvider.GetValue("Name"), Description = dataProvider.GetValue("Description"), VideoUri = dataProvider.GetValue("VideoUri"), ProductName = dataProvider.GetValue("ProductName"), Avsx = dataProvider.GetFile("Avsx"), Screenshot = dataProvider.GetFile("Screenshot") }; if (dataProvider.Contains("Access")) { result.Access = dataProvider.GetValue("Access", ProjectAccess.Public); } if (dataProvider.Contains("EnableComments")) { result.EnableComments = dataProvider.GetValue("EnableComments", true); } if (dataProvider.Contains("ProjectType", true)) { result.ProjectType = dataProvider.GetValue("ProjectType", ProjectType.None); } if (dataProvider.Contains("ProjectSubtype", true)) { result.ProjectSubtype = dataProvider.GetValue("ProjectSubtype", ProjectSubtype.None); } return result; }