![]() |
VOOZH | about |
dotnet add package Sufficit.EFData --version 1.26.616.1631
NuGet\Install-Package Sufficit.EFData -Version 1.26.616.1631
<PackageReference Include="Sufficit.EFData" Version="1.26.616.1631" />
<PackageVersion Include="Sufficit.EFData" Version="1.26.616.1631" />Directory.Packages.props
<PackageReference Include="Sufficit.EFData" />Project file
paket add Sufficit.EFData --version 1.26.616.1631
#r "nuget: Sufficit.EFData, 1.26.616.1631"
#:package Sufficit.EFData@1.26.616.1631
#addin nuget:?package=Sufficit.EFData&version=1.26.616.1631Install as a Cake Addin
#tool nuget:?package=Sufficit.EFData&version=1.26.616.1631Install as a Cake Tool
<h1> Sufficit.EFData <a href="https://github.com/sufficit"><img src="https://avatars.githubusercontent.com/u/66928451?s=200&v=4" alt="Sufficit Logo" width="80" align="right"></a> </h1>
π NuGet Version
π .NET Standard
π License: MIT
Entity Framework Data Providers for Sufficit Ecosystem
A comprehensive .NET library that provides Entity Framework-based data access providers for the Sufficit platform. This library implements the Provider Architecture Pattern with extension methods for optimal performance and maintainability.
Sufficit.EFData is a core component of the Sufficit ecosystem, providing standardized data access patterns using Entity Framework Core. The library implements a consistent provider architecture that ensures:
Sufficit.EFData/
βββ EFProvider<TContext> # Abstract base provider
βββ ScopedProvider # Scoped service management
βββ Extension Methods # Query extensions
βββ DbContext Implementations # Database contexts
public abstract class EFProvider<DBContext> : ScopedProvider
where DBContext : Microsoft.EntityFrameworkCore.DbContext
{
protected EFProvider(IServiceScopeFactory serviceScopeFactory)
: base(serviceScopeFactory) { }
protected DBContext CreateDbContext(IServiceScope scope)
=> scope.ServiceProvider.GetRequiredService<DBContext>();
}
public static class EFMessageTemplateProviderExtensions
{
public static async Task<MessageTemplate?> GetByTitleAsync(
this EFMessageTemplateProvider provider,
string title,
CancellationToken cancellationToken = default)
{
return await provider.Search(new MessageTemplateSearchParameters
{
Title = title
}).FirstOrDefaultAsync(cancellationToken);
}
}
# Install via NuGet
dotnet add package Sufficit.EFData
# Or via Package Manager
Install-Package Sufficit.EFData
<PackageReference Include="Sufficit.EFData" Version="1.0.0" />
// Program.cs or Startup.cs
using Microsoft.Extensions.DependencyInjection;
using Sufficit.EFData;
public void ConfigureServices(IServiceCollection services)
{
// Add database context
services.AddDbContext<ExchangeDbContext>(options =>
options.UseMySql(connectionString,
new MySqlServerVersion(new Version(8, 0, 21))));
// Register providers
services.AddSufficitEFData();
}
public class MessageService
{
private readonly EFMessageTemplateProvider _provider;
public MessageService(EFMessageTemplateProvider provider)
{
_provider = provider;
}
public async Task<MessageTemplate?> GetTemplateAsync(string title)
{
// Using extension method
return await _provider.GetByTitleAsync(title);
}
public async Task<IEnumerable<MessageTemplate>> SearchTemplatesAsync(
string? searchTerm = null,
int page = 1,
int pageSize = 20)
{
// Using base Search method
return await _provider.Search(new MessageTemplateSearchParameters
{
Title = searchTerm,
Paging = new PagingParameters { Page = page, PageSize = pageSize }
}).ToListAsync();
}
}
public async Task<IEnumerable<MessageTemplate>> GetActiveTemplatesAsync()
{
return await _provider.Search(new MessageTemplateSearchParameters
{
IsActive = true,
Sorting = new SortingParameters
{
SortBy = "CreatedAt",
SortDirection = SortDirection.Descending
}
}).ToListAsync();
}
Handles email templates, message tracking, and communication logs.
// Usage
public class EmailService
{
private readonly EFMessageTemplateProvider _templateProvider;
private readonly EFEMailTrackingProvider _trackingProvider;
public async Task SendTemplatedEmailAsync(string templateTitle, string recipient)
{
var template = await _templateProvider.GetByTitleAsync(templateTitle);
if (template == null) return;
// Send email logic here
await _trackingProvider.TrackEmailAsync(template.Id, recipient);
}
}
Manages user authentication and authorization data.
// Register Identity providers
services.AddSufficitIdentityProviders();
// Usage
public class UserService
{
private readonly EFIdentityProvider _identityProvider;
public async Task<User?> AuthenticateAsync(string username, string password)
{
return await _identityProvider.AuthenticateAsync(username, password);
}
}
Handles call records, CDR data, and telephony operations.
// Register Telephony providers
services.AddSufficitTelephonyProviders();
// Usage
public class CallService
{
private readonly EFCallRecordProvider _callProvider;
public async Task<IEnumerable<CallRecord>> GetRecentCallsAsync(string extension)
{
return await _callProvider.Search(new CallRecordSearchParameters
{
Extension = extension,
DateRange = new DateTimeRange
{
Start = DateTime.UtcNow.AddDays(-7),
End = DateTime.UtcNow
}
}).ToListAsync();
}
}
{
"ConnectionStrings": {
"ExchangeDb": "Server=localhost;Database=exchange;User=user;Password=password;",
"IdentityDb": "Server=localhost;Database=identity;User=user;Password=password;",
"TelephonyDb": "Server=localhost;Database=telephony;User=user;Password=password;"
}
}
public void ConfigureServices(IServiceCollection services)
{
// Database contexts
services.AddDbContext<ExchangeDbContext>(options =>
options.UseMySql(Configuration.GetConnectionString("ExchangeDb"),
new MySqlServerVersion(new Version(8, 0, 21))));
services.AddDbContext<IdentityDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("IdentityDb")));
// Providers
services.AddSufficitEFData();
}
// In Program.cs
using Microsoft.EntityFrameworkCore;
var app = builder.Build();
// Apply migrations
using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<ExchangeDbContext>();
await dbContext.Database.MigrateAsync();
}
Sufficit.EFData/
βββ src/
β βββ EFProvider.cs # Base provider class
β βββ ScopedProvider.cs # Scoped service management
β βββ DEFAULT.cs # Constants and utilities
β βββ Exchange/ # Exchange domain providers
β βββ Identity/ # Identity domain providers
β βββ Telephony/ # Telephony domain providers
β βββ Contacts/ # Contacts domain providers
β βββ Finance/ # Finance domain providers
β βββ Extensions/ # Extension methods
βββ tests/ # Unit tests
βββ docs/ # Documentation
βββ migrations-tool/ # Migration utilities
# Restore dependencies
dotnet restore
# Build for all target frameworks
dotnet build --configuration Release
# Run tests
dotnet test
# Create NuGet package
dotnet pack --configuration Release
// Example unit test
[Fact]
public async Task GetByTitleAsync_ReturnsCorrectTemplate()
{
// Arrange
var options = new DbContextOptionsBuilder<ExchangeDbContext>()
.UseInMemoryDatabase(databaseName: "TestDb")
.Options;
using var context = new ExchangeDbContext(options);
var provider = new EFMessageTemplateProvider(context);
// Act
var result = await provider.GetByTitleAsync("Welcome Email");
// Assert
Assert.NotNull(result);
Assert.Equal("Welcome Email", result.Title);
}
We welcome contributions! Please follow these guidelines:
Fork the repository
Clone your fork
git clone https://github.com/yourusername/sufficit-efdata.git
cd sufficit-efdata
Create a feature branch
git checkout -b feature/new-provider
Make your changes
Add tests for new functionality
Ensure all tests pass
dotnet test
Submit a pull request
Use conventional commit format:
feat: add new email tracking provider
fix: resolve connection timeout issue
docs: update API documentation
test: add unit tests for message templates
This project is licensed under the MIT License - see the file for details.
Developed by Sufficit SoluΓ§Γ΅es em Tecnologia da InformaΓ§Γ£o
For more information, visit our GitHub repository or contact .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on Sufficit.EFData:
| Package | Downloads |
|---|---|
|
Sufficit.Communication
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.26.616.1631 | 40 | 6/16/2026 |
| 1.26.612.2110 | 74 | 6/12/2026 |
| 1.26.612.2045 | 86 | 6/12/2026 |
| 1.26.604.2158 | 107 | 6/4/2026 |
| 1.26.529.1513 | 107 | 5/29/2026 |
| 1.26.526.1524 | 96 | 5/26/2026 |
| 1.26.504.2036 | 141 | 5/4/2026 |
| 1.26.504.1323 | 110 | 5/4/2026 |
| 1.26.430.2043 | 149 | 4/30/2026 |
| 1.26.415.353 | 136 | 4/15/2026 |
| 1.26.402.1343 | 184 | 4/2/2026 |
| 1.26.331.1955 | 126 | 3/31/2026 |
| 1.26.330.1254 | 135 | 3/30/2026 |
| 1.26.327.2021 | 122 | 3/27/2026 |
| 1.26.325.1643 | 168 | 3/25/2026 |
| 1.26.324.255 | 119 | 3/24/2026 |
| 1.26.319.1856 | 164 | 3/19/2026 |
| 1.26.313.1917 | 244 | 3/13/2026 |
| 1.26.306.1250 | 131 | 3/6/2026 |
| 1.26.304.2055 | 124 | 3/4/2026 |