FormCollectionExtend.MVC
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package FormCollectionExtend.MVC --version 1.0.0
NuGet\Install-Package FormCollectionExtend.MVC -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FormCollectionExtend.MVC" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FormCollectionExtend.MVC --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FormCollectionExtend.MVC, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FormCollectionExtend.MVC as a Cake Addin #addin nuget:?package=FormCollectionExtend.MVC&version=1.0.0 // Install FormCollectionExtend.MVC as a Cake Tool #tool nuget:?package=FormCollectionExtend.MVC&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FormCollectionExtend.MVC
Synopsis
MVC FormCollection To Object Extend Library. Easy Convert FormCollection To Object.
Features
- Convert FormCollection To Single Object
- Convert FormCollection To Single Object with Mapping Dictionary
- Convert FormCollection To List<Object>
- Convert FormCollection To List<Object> with Mapping Dictionary
Examples
ToSingleObject(this FormCollection collection)
Convert FormCollection To Single Object.
// Arrange
FormCollection Stub = CreateTestData();
// Act
TestModel Test = Stub.ToSingleObject<TestModel>();
ToSingleObject(this FormCollection collection, Dictionary<string, string> MappingDictionary)
Convert FormCollection To Single Object with Mapping Dictionary.
// Arrange
FormCollection Stub = CreateTestDataWithDifferentNaming();
Dictionary<string, string> MappingDictionary = CreateMappingDictionary();
// Act
TestModel Test = Stub.ToSingleObject<TestModel>(MappingDictionary);
ToListObject(this FormCollection collection)
Convert FormCollection To List<Object>.
// Arrange
FormCollection Stub = CreateTestDataSet();
string PrimaryKeyName = "Name";
// Act
List<TestModel> Test = Stub.ToListObject<TestModel>(PrimaryKeyName);
ToListObjectWithMappingDictionary(this FormCollection collection, Dictionary<string, string> MappingDictionary)
Convert FormCollection To List<Object> with Mapping Dictionary.
// Arrange
FormCollection Stub = CreateTestDataSetWithDifferentNaming();
Dictionary<string, string> MappingDictionary = CreateMappingDictionary();
string PrimaryKeyName = "Name111";
// Act
List<TestModel> Test = Stub.ToListObject<TestModel>(MappingDictionary, PrimaryKeyName);
About Mapping Dictionary
Example:
Dictionary<string, string> CreateMappingDictionary()
{
// Key.Add( "後端物件屬性", "前端表單欄位Name" );
// Key.Add( "Model Object Property", "Form Field Name" );
Dictionary<string, string> Key = new Dictionary<string, string>();
Key.Add("Name", "Name111");
Key.Add("age", "age222");
Key.Add("PhoneNumber", "PhoneNumber333");
Key.Add("Married", "Married444");
Key.Add("CreatedDateTime", "CreatedDateTime555");
Key.Add("ModifyDateTime", "ModifyDateTime666");
return Key;
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- Microsoft.AspNet.Mvc (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Init FormCollection Extension.