Method.Results.Net.Full
1.0.4
dotnet add package Method.Results.Net.Full --version 1.0.4
NuGet\Install-Package Method.Results.Net.Full -Version 1.0.4
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="Method.Results.Net.Full" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Method.Results.Net.Full --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Method.Results.Net.Full, 1.0.4"
#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 Method.Results.Net.Full as a Cake Addin #addin nuget:?package=Method.Results.Net.Full&version=1.0.4 // Install Method.Results.Net.Full as a Cake Tool #tool nuget:?package=Method.Results.Net.Full&version=1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Requaried
using Results.Abstract;
using Results.State;
How to use
IResult default
public IResult Add(string text)
{
if(text == null)
{
return new ErrorResult(); // ErrorResult => false
}
//add operation
return new SuccessResult(); // SuccessResult => true
}
IResult Overloads (message)
public IResult Add(string text)
{
if(text == null)
{
return new ErrorResult(message:"Not Null"); // ErrorResult => false and message
}
//add operation
return new SuccessResult(message:" Success Add "); // SuccessResult => true and message
}
IResult Overloads (message and tags)
public IResult Add(string text)
{
if(text == null)
{
return new ErrorResult(message:"Not Null","Errortag","ErrorTag1","ErrorTag2"); // ErrorResult => false , message and tags
}
//add operation
return new SuccessResult(message:" Success Add ","Successtag","SuccessTag1","SuccessTag2"); // SuccessResult => true , message and tags
}
ISingleDataResult<SingleData>
public ISingleDataResult<Product> GetByProductId(int productId)
{
// SuccessSingleDataResult<Product> => Product and true
return new SuccessSingleDataResult<Product>(_productDal.GetProduct(product => product.Id == productId));
}
ISingleDataResult<SingleData> OverLoads
public ISingleDataResult<Product> GetByProductId(int productId)
{
// SuccessSingleDataResult<Product> => Product , true and message
return new SuccessSingleDataResult<Product>(_productDal.GetProduct(product => product.Id == productId),message:" Data Listed ");
}
IListDataResult<ListData>
public IListDataResult<Product> GetByCategory(int categoryId)
{
// SuccessListDataResult<Product> => List<Product> , true and count
return new SuccessListDataResult<Product>(_productDal.GetAll(product => product.categoryId == categoryId));
}
IListDataResult<ListData> OverLoads
public IListDataResult<Product> GetByCategory(int categoryId)
{
// SuccessListDataResult<Product> => List<Product> , true , message and count
return new SuccessListDataResult<Product>(_productDal.GetAll(product => product.categoryId == categoryId),message:"data listed");
}
IDataResult<Data>
public IDataResult<Product> GetByProductId(int productId)
{
// SuccessDataResult<Product> => Product and true
return new SuccessDataResult<Product>(_productDal.Get(product => product.productId == productId));
}
IDataResult<Data> OverLoads
public IDataResult<Product> GetByProductId(int productId)
{
// SuccessDataResult<Product> => Product , true , message and tags
return new SuccessDataResult<Product>(_productDal.Get(product => product.productId == productId),message:"data listed","tag1","tag2");
}
IDataResult<Data> List
public IDataResult<List<Product>> GetAll()
{
// SuccessDataResult<List<Product>> => Product List and true
return new SuccessDataResult<List<Product>>(_productDal.GetAll());
}
IDataResult<Data> List OverLoads
public IDataResult<List<Product>> GetAll()
{
// SuccessDataResult<List<Product>> => Product List, true , message and tags
return new SuccessDataResult<List<Product>>(_productDal.GetAll(),message:"data listed","tag1","tag2");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Full Version Method Results