Skip to content

Commit 08e76e0

Browse files
committedDec 9, 2024
Changed the persistence level.
1 parent 5b93851 commit 08e76e0

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed
 

‎Azon.Web.Persistence/DbPersistence.cs ‎Azon.Web.Persistence/OraclePersistence.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33

44
namespace Azon.Web.Persistence;
55

6-
public class DbPersistence
7-
: IPersistence
6+
public class OraclePersistence
7+
:IDatabasePersistence
88
{
9+
public string ConnectionString { get; set; }
10+
public string UserName { get; set; }
11+
912
public void Save(List<Control> controls)
1013
{
1114
Console.WriteLine("Database save");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Azon.Web.Sdk.Components;
2+
using Azon.Web.Sdk.Contracts;
3+
4+
namespace Azon.Web.Persistence;
5+
6+
public class SqlServerPersistence
7+
: IDatabasePersistence
8+
{
9+
public string ConnectionString { get; set ; }
10+
public string UserName { get ; set; }
11+
12+
public void Save(List<Control> controls)
13+
{
14+
Console.WriteLine("Database save");
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Azon.Web.Sdk.Contracts;
2+
3+
public interface IDatabasePersistence
4+
: IPersistence
5+
{
6+
string ConnectionString { get; set; }
7+
string UserName { get; set; }
8+
}

‎Azon.Web.Sdk/Contracts/IPersistence.cs

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,21 @@
22

33
namespace Azon.Web.Sdk.Contracts;
44

5+
/*
6+
Aşağıdaki arayüz generic hale çevrilmiştir. Yani T türü yerine herhangi bir tip gelebilir,
7+
arayüz içerisindeki üyelerde T görülen yerlere seçilen tip gelir.
8+
9+
Buradaki senaryoda T türü için kısıt koymak gerekir (Generic Constraints)
10+
*/
11+
//public interface IPersistence<T>
12+
// // where T: class,new() // Burada T türünün bir sınıf olması ve mutlaka default constructor içermesi belirtiliyor
13+
// // where T : Control, IDrawable // Burada ise T türünün Control sınıfından türemiş olması ve IDrawable arayüzünü implemente etmiş olması gerektiği belirtiliyor
14+
// // where T : Control
15+
//{
16+
// void Save(List<T> controls);
17+
//}
18+
519
public interface IPersistence
620
{
721
void Save(List<Control> controls);
8-
}
22+
}

0 commit comments

Comments
 (0)
Please sign in to comment.