Codeove.AspNetMvcTools
1.0.0
dotnet add package Codeove.AspNetMvcTools --version 1.0.0
NuGet\Install-Package Codeove.AspNetMvcTools -Version 1.0.0
<PackageReference Include="Codeove.AspNetMvcTools" Version="1.0.0" />
<PackageVersion Include="Codeove.AspNetMvcTools" Version="1.0.0" />
<PackageReference Include="Codeove.AspNetMvcTools" />
paket add Codeove.AspNetMvcTools --version 1.0.0
#r "nuget: Codeove.AspNetMvcTools, 1.0.0"
#:package Codeove.AspNetMvcTools@1.0.0
#addin nuget:?package=Codeove.AspNetMvcTools&version=1.0.0
#tool nuget:?package=Codeove.AspNetMvcTools&version=1.0.0
Codeove ASPNET Core MVC Tools
ASP.NET Core MVC projelerinde kullan�lmak �zere �e�itli yard�mc� metotlar ve geni�letmeler i�eren bir k�t�phane.
- EnumTool
- TempData Extensions
EnumTool
Bu k�t�phane, enum tipleri ile �al��may� kolayla�t�ran geni�letme metotlar� sa�lar. Enum de�erlerini KeyValuePair olarak alma, t�m enum de�erlerini listeleme, byte t�r�nde dictionary olu�turma ve byte'dan enum de�eri bulma gibi i�levler sunar. Ayr�ca, LINQ sorgular� ve JSON serile�tirme i�lemleri i�in de kullan�labilir.
using System.ComponentModel;
// Enum tan�m�
public enum UserStatus : byte // byte olarak tan�mlayabiliriz
{
[Description("Aktif Kullan�c�")]
Active = 1,
[Description("Pasif Kullan�c�")]
Inactive = 2,
[Description("Ask�ya Al�nm��")]
Suspended = 3
}
public enum PermissionLevel : byte
{
[Description("Okuma")]
Read = 10,
[Description("Yazma")]
Write = 20,
[Description("Y�netici")]
Admin = 30
}
class Program
{
static void Main()
{
// Tekil enum de�erini KeyValuePair olarak alma
var status = UserStatus.Active;
var keyValuePair = status.ToKeyValuePair();
Console.WriteLine($"Key: {keyValuePair.Key}, Value: {keyValuePair.Value}");
// ��kt�: Key: 1, Value: Aktif Kullan�c�
// T�m enum de�erlerini listeleme
var allValues = EnumExtensions.GetAllKeyValuePairs<UserStatus>();
foreach (var kvp in allValues)
{
Console.WriteLine($"ID: {kvp.Key}, A��klama: {kvp.Value}");
}
// ��kt�:
// ID: 1, A��klama: Aktif Kullan�c�
// ID: 2, A��klama: Pasif Kullan�c�
// ID: 3, A��klama: Ask�ya Al�nm��
// Dictionary olarak alma
var dict = EnumExtensions.ToByteDictionary<UserStatus>();
Console.WriteLine($"Dictionary Count: {dict.Count}"); // 3
// Byte'dan enum de�eri bulma
var fromByte = EnumExtensions.FromByte<UserStatus>(2);
Console.WriteLine($"From byte 2: Key: {fromByte.Key}, Value: {fromByte.Value}");
// ��kt�: Key: 2, Value: Pasif Kullan�c�
// Birden fazla byte'dan de�er bulma
var multiple = EnumExtensions.FromBytes<UserStatus>(1, 3).ToList();
foreach (var item in multiple)
{
Console.WriteLine($"Multiple: {item.Key} - {item.Value}");
}
// LINQ ile kullan�m
var activeItems = allValues.Where(kvp => kvp.Value.Contains("Aktif"));
var firstItem = allValues.FirstOrDefault(kvp => kvp.Key == 1);
// JSON serialization i�in kullan�m
var jsonReadyData = dict.Select(kvp => new
{
Id = kvp.Key,
Name = kvp.Value
}).ToList();
// Farkl� enum tipi ile kullan�m
var permissions = EnumExtensions.GetAllKeyValuePairs<PermissionLevel>();
foreach (var perm in permissions)
{
Console.WriteLine($"Permission: {perm.Key} = {perm.Value}");
}
// ��kt�:
// Permission: 10 = Okuma
// Permission: 20 = Yazma
// Permission: 30 = Y�netici
}
}
TempData Extensions
ASP.NET Core MVC projelerinde TempData ile �al��may� kolayla�t�ran geni�letme metotlar� sa�lar. Nesneleri JSON format�nda TempData'ya kaydetme ve okuma i�lemlerini basitle�tirir.
TempData.Put("Message", new Message { Text = "OK", Type = "success" });
var msg = TempData.Get<Message>("Message");
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.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 | 502 | 12/9/2025 |