Ossendorf.Csla.DataPortalExtensionGenerator
0.0.1-alpha4.6
See the version list below for details.
dotnet add package Ossendorf.Csla.DataPortalExtensionGenerator --version 0.0.1-alpha4.6
NuGet\Install-Package Ossendorf.Csla.DataPortalExtensionGenerator -Version 0.0.1-alpha4.6
<PackageReference Include="Ossendorf.Csla.DataPortalExtensionGenerator" Version="0.0.1-alpha4.6" />
paket add Ossendorf.Csla.DataPortalExtensionGenerator --version 0.0.1-alpha4.6
#r "nuget: Ossendorf.Csla.DataPortalExtensionGenerator, 0.0.1-alpha4.6"
// Install Ossendorf.Csla.DataPortalExtensionGenerator as a Cake Addin #addin nuget:?package=Ossendorf.Csla.DataPortalExtensionGenerator&version=0.0.1-alpha4.6&prerelease // Install Ossendorf.Csla.DataPortalExtensionGenerator as a Cake Tool #tool nuget:?package=Ossendorf.Csla.DataPortalExtensionGenerator&version=0.0.1-alpha4.6&prerelease
DataPortal extensions for CSLA.NET
A Source Generator package that generates extension methods for IDataPortal<T>
and IChildDataPortal<T>
.
The extension methods are derived from annotated methods of business objects using CSLA.NET attributes like Fetch
, Create
, ...
.
How to install
dotnet add package Ossendorf.Csla.DataPortalExtensionsGenerator
<PackageReference Include="Ossendorf.Csla.DataPortalExtensionsGenerator" Version="0.0.1-pre02" PrivateAssets="all" ExcludeAssets="runtime" />
Either way adds the source generator to your project. Make sure to add PrivateAssets="all" ExcludeAssets="runtime"
to mark it as a build dependency. Otherwise it flows to projects which depend on your project.
To use the generator, add the [Ossendorf.Csla.DataPortalExtensionsGenerator.DataPortalExtensions]
attribute to a class which should containt the extensions.
For example:
[Ossendorf.Csla.DataPortalExtensionsGenerator.DataPortalExtensions]
public static partial class DataPortalExtensions {
}
Your business object:
namespace MyNamespace;
public class Address : BusinessBase<Address> {
[Create]
private void CreateLocally() {
// creation logic
}
[Fetch]
private async Task ById(Guid id) {
// fetch logic
}
}
This will generate the following code:
static partial class DataPortalExtensions {
public static global::System.Threading.Tasks.Task<global::MyNamespace.Address> CreateLocally(this global::Csla.IDataPortal<global::MyNamespace.Address> portal) => portal.CreateAsync();
public static global::System.Threading.Tasks.Task<global::MyNamespace.Address> ById(this global::Csla.IDataPortal<global::MyNamespace.Address> portal, global::System.Guid id) => portal.FetchAsync(id);
}
Raodmap
- Special case commands to an extension like
commandPortal.ExecuteCommand(<params>)
which combinesCreate
+Execute
. - Support for generic business objects
- Improve handling of csla method parameters which are
internal
and not available - Add configurability
- Add attribute as prefix/suffix:
ById(id)
→FetchById(id)
ById(id)
→ByIdFetch(id)
- Exclude non-public business objects from generation
- Exclude methods with non-public parameter types
- Add attribute as prefix/suffix:
- Add attribute to exclude methods explicitly
A lot of implementation details are derived/taken from the great series Andrew Lock: Creating a source generator. If you want to create your own source generator I can recommend that series wholeheartedly.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.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.
Version | Downloads | Last updated | |
---|---|---|---|
1.0.0 | 1,932 | 10/7/2024 | |
0.5.0-preview1 | 2,631 | 3/31/2024 | |
0.4.1-preview1 | 148 | 3/1/2024 | |
0.4.0-preview1 | 102 | 2/27/2024 | |
0.3.0-preview3 | 360 | 2/25/2024 | |
0.3.0-preview2 | 80 | 2/25/2024 | |
0.2.0-preview1.9 | 59 | 2/25/2024 | |
0.2.0-preview1 | 107 | 2/22/2024 | |
0.1.0-preview2 | 83 | 2/21/2024 | |
0.1.0-preview1 | 97 | 2/11/2024 | |
0.0.1-alpha4.7 | 80 | 2/10/2024 | |
0.0.1-alpha4.6 | 70 | 2/10/2024 | |
0.0.1-alpha4.3 | 70 | 2/10/2024 |