Sewerdamages angefangen
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
using DaSaSo.ConsoleApp;
|
||||
using DaSaSo.Domain.Model;
|
||||
using DaSaSo.Domain.Services;
|
||||
using DaSaSo.EntityFramework;
|
||||
using DaSaSo.EntityFramework.Services;
|
||||
using System.Diagnostics;
|
||||
|
||||
IDataService<Client> clientService = new GenericDataService<Client>(new DaSaSoDbContextFactory(""));
|
||||
clientService.Create(new Client()
|
||||
{
|
||||
Firstname = "Cynthia",
|
||||
LastName = "Schreuder",
|
||||
Country = "Tarmstedt",
|
||||
Postcode = "25445",
|
||||
});
|
||||
|
||||
testclass test = new testclass();
|
||||
test.data = efields.CATRA | efields.PRO;
|
||||
|
||||
var s = test.data.HasFlag(efields.CATRA);
|
||||
|
||||
Debugger.Break();
|
||||
|
||||
38
DaSaSo.ConsoleApp/testclass.cs
Normal file
38
DaSaSo.ConsoleApp/testclass.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DaSaSo.ConsoleApp
|
||||
{
|
||||
class testclass
|
||||
{
|
||||
public efields data;
|
||||
}
|
||||
|
||||
[Flags]
|
||||
enum efields : int
|
||||
{
|
||||
PRO = 1,
|
||||
CONTRA = 2,
|
||||
DESPRED = 4,
|
||||
CATRA = 8
|
||||
};
|
||||
|
||||
static class EnumerationExtensions
|
||||
{
|
||||
public static bool Has<T>(this System.Enum type, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (((int)(object)type & (int)(object)value) == (int)(object)value);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user