diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/FileContentIndex/794c0bb5-712e-4ca0-a462-b9205f93f5e5.vsidx b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/FileContentIndex/794c0bb5-712e-4ca0-a462-b9205f93f5e5.vsidx new file mode 100644 index 0000000..f99c466 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/FileContentIndex/794c0bb5-712e-4ca0-a462-b9205f93f5e5.vsidx differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/FileContentIndex/ec0a0821-a410-4fd0-ad0d-393b5ba9f39b.vsidx b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/FileContentIndex/ec0a0821-a410-4fd0-ad0d-393b5ba9f39b.vsidx new file mode 100644 index 0000000..70aef67 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/FileContentIndex/ec0a0821-a410-4fd0-ad0d-393b5ba9f39b.vsidx differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v16/.suo b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v16/.suo new file mode 100644 index 0000000..8ace355 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v16/.suo differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/.suo b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/.suo new file mode 100644 index 0000000..dc72972 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/.suo differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/DocumentLayout.backup.json b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/DocumentLayout.backup.json new file mode 100644 index 0000000..011dcd6 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/DocumentLayout.backup.json @@ -0,0 +1,88 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}|DIP_Solution04\\DIP_Solution04.csproj|e:\\ali\\programming\\asp.net\\mft\\projects\\h\\session07\\session07\\session07\\dip_solution04\\framework\\interface\\iservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}|DIP_Solution04\\DIP_Solution04.csproj|solutionrelative:dip_solution04\\framework\\interface\\iservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}|DIP_Solution04\\DIP_Solution04.csproj|e:\\ali\\programming\\asp.net\\mft\\projects\\h\\session07\\session07\\session07\\dip_solution04\\framework\\base\\baseservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}|DIP_Solution04\\DIP_Solution04.csproj|solutionrelative:dip_solution04\\framework\\base\\baseservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}|DIP_Solution04\\DIP_Solution04.csproj|e:\\ali\\programming\\asp.net\\mft\\projects\\h\\session07\\session07\\session07\\dip_solution04\\lifecycle\\a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}|DIP_Solution04\\DIP_Solution04.csproj|solutionrelative:dip_solution04\\lifecycle\\a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}|DIP_Solution04\\DIP_Solution04.csproj|e:\\ali\\programming\\asp.net\\mft\\projects\\h\\session07\\session07\\session07\\dip_solution04\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}|DIP_Solution04\\DIP_Solution04.csproj|solutionrelative:dip_solution04\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 3, + "Children": [ + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "Program.cs", + "DocumentMoniker": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\DIP_Solution04\\Program.cs", + "RelativeDocumentMoniker": "DIP_Solution04\\Program.cs", + "ToolTip": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\DIP_Solution04\\Program.cs", + "RelativeToolTip": "DIP_Solution04\\Program.cs", + "ViewState": "AQIAAAYAAAAAAAAAAAAAABoAAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-12-24T11:21:29.832Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "A.cs", + "DocumentMoniker": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\DIP_Solution04\\LifeCycle\\A.cs", + "RelativeDocumentMoniker": "DIP_Solution04\\LifeCycle\\A.cs", + "ToolTip": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\DIP_Solution04\\LifeCycle\\A.cs", + "RelativeToolTip": "DIP_Solution04\\LifeCycle\\A.cs", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAAFAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-12-24T11:20:14.812Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "BaseService.cs", + "DocumentMoniker": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\DIP_Solution04\\Framework\\Base\\BaseService.cs", + "RelativeDocumentMoniker": "DIP_Solution04\\Framework\\Base\\BaseService.cs", + "ToolTip": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\DIP_Solution04\\Framework\\Base\\BaseService.cs", + "RelativeToolTip": "DIP_Solution04\\Framework\\Base\\BaseService.cs", + "ViewState": "AQIAAAgAAAAAAAAAAAAAAAoAAAAFAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-12-24T11:18:54.027Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "IService.cs", + "DocumentMoniker": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\DIP_Solution04\\Framework\\Interface\\IService.cs", + "RelativeDocumentMoniker": "DIP_Solution04\\Framework\\Interface\\IService.cs", + "ToolTip": "E:\\Ali\\Programming\\ASP.net\\MFT\\Projects\\H\\Session07\\Session07\\Session07\\DIP_Solution04\\Framework\\Interface\\IService.cs", + "RelativeToolTip": "DIP_Solution04\\Framework\\Interface\\IService.cs", + "ViewState": "AQIAAAgAAAAAAAAAAAAAAAsAAAAoAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-12-24T11:17:34.805Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/DocumentLayout.json b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/DocumentLayout.json new file mode 100644 index 0000000..8261764 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/.vs/Session07/v17/DocumentLayout.json @@ -0,0 +1,87 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\TheOrder\\ALI_Session07\\Session07\\Session07\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{BC5774AA-BBB0-4474-ADE6-00C748D812A9}|DIP_Solution05\\DIP_Solution05.csproj|e:\\theorder\\ali_session07\\session07\\session07\\dip_solution05\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{BC5774AA-BBB0-4474-ADE6-00C748D812A9}|DIP_Solution05\\DIP_Solution05.csproj|solutionrelative:dip_solution05\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{BC5774AA-BBB0-4474-ADE6-00C748D812A9}|DIP_Solution05\\DIP_Solution05.csproj|e:\\theorder\\ali_session07\\session07\\session07\\dip_solution05\\externalservice\\service01.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{BC5774AA-BBB0-4474-ADE6-00C748D812A9}|DIP_Solution05\\DIP_Solution05.csproj|solutionrelative:dip_solution05\\externalservice\\service01.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{BC5774AA-BBB0-4474-ADE6-00C748D812A9}|DIP_Solution05\\DIP_Solution05.csproj|e:\\theorder\\ali_session07\\session07\\session07\\dip_solution05\\lifecycle\\a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{BC5774AA-BBB0-4474-ADE6-00C748D812A9}|DIP_Solution05\\DIP_Solution05.csproj|solutionrelative:dip_solution05\\lifecycle\\a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 4, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{eefa5220-e298-11d0-8f78-00a0c9110057}" + }, + { + "$type": "Bookmark", + "Name": "ST:1:0:{e8b06f52-6d01-11d2-aa7d-00c04f990343}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{b1e99781-ab81-11d0-b683-00aa00a3ee26}" + }, + { + "$type": "Bookmark", + "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "Program.cs", + "DocumentMoniker": "E:\\TheOrder\\ALI_Session07\\Session07\\Session07\\DIP_Solution05\\Program.cs", + "RelativeDocumentMoniker": "DIP_Solution05\\Program.cs", + "ToolTip": "E:\\TheOrder\\ALI_Session07\\Session07\\Session07\\DIP_Solution05\\Program.cs", + "RelativeToolTip": "DIP_Solution05\\Program.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAYAAAAWAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T14:46:14.368Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "A.cs", + "DocumentMoniker": "E:\\TheOrder\\ALI_Session07\\Session07\\Session07\\DIP_Solution05\\LifeCycle\\A.cs", + "RelativeDocumentMoniker": "DIP_Solution05\\LifeCycle\\A.cs", + "ToolTip": "E:\\TheOrder\\ALI_Session07\\Session07\\Session07\\DIP_Solution05\\LifeCycle\\A.cs", + "RelativeToolTip": "DIP_Solution05\\LifeCycle\\A.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAACgAAAAJAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T13:38:51.898Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "Service01.cs", + "DocumentMoniker": "E:\\TheOrder\\ALI_Session07\\Session07\\Session07\\DIP_Solution05\\ExternalService\\Service01.cs", + "RelativeDocumentMoniker": "DIP_Solution05\\ExternalService\\Service01.cs", + "ToolTip": "E:\\TheOrder\\ALI_Session07\\Session07\\Session07\\DIP_Solution05\\ExternalService\\Service01.cs", + "RelativeToolTip": "DIP_Solution05\\ExternalService\\Service01.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAABsAAAAFAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T12:47:52.844Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01.rar b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01.rar new file mode 100644 index 0000000..e7c24a4 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01.rar differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01.zip b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01.zip new file mode 100644 index 0000000..5aae9a6 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01.zip differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/App.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/DIP_Solution01.csproj b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/DIP_Solution01.csproj new file mode 100644 index 0000000..75033b1 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/DIP_Solution01.csproj @@ -0,0 +1,60 @@ + + + + + Debug + AnyCPU + {0486B1D9-EAFD-4449-B375-BCD2F2819933} + Exe + DIP_Solution01 + DIP_Solution01 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service01.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service01.cs new file mode 100644 index 0000000..07a8b09 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service01.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution01.ExternalService +{ + public class Service01 + { + #region [ - Ctor - ] + public Service01() + { + + } + #endregion + + #region [ - Method - ] + public void M1() + { + Console.WriteLine("M1 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service02.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service02.cs new file mode 100644 index 0000000..8df60c6 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service02.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution01.ExternalService +{ + public class Service02 + { + #region [ - Ctor - ] + public Service02() + { + + } + #endregion + + #region [ - Method - ] + public void M2() + { + Console.WriteLine("M2 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service03.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service03.cs new file mode 100644 index 0000000..57a8b04 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/ExternalService/Service03.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution01.ExternalService +{ + public class Service03 + { + #region [ - Ctor - ] + public Service03() + { + + } + #endregion + + #region [ - Method - ] + public void M3() + { + Console.WriteLine("M3 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/A.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/A.cs new file mode 100644 index 0000000..211b7c1 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/A.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution01.LifeCycle +{ + public class A + { + #region [ - Ctor - ] + public A(ExternalService.Service01 service01, + ExternalService.Service02 service02, + ExternalService.Service03 service03) + { + //Eager Composition + //Ref_Service01 = new ExternalService.Service01(); + //Ref_Service02 = new ExternalService.Service02(); + //Ref_Service03 = new ExternalService.Service03(); + + //Eager Aggregation + Ref_Service01 = service01; + Ref_Service02 = service02; + Ref_Service03 = service03; + + } + #endregion + + #region [ - Props - ] + public ExternalService.Service01 Ref_Service01 { get; set; } + public ExternalService.Service02 Ref_Service02 { get; set; } + public ExternalService.Service03 Ref_Service03 { get; set; } + #endregion + + #region [ - Methods - ] + + ////Lazy Composition: + + //#region [ - InitializeService01Refrence() - ] + + //public void InitializeService01Refrence() + //{ + // Ref_Service01 = new ExternalService.Service01(); + //} + //#endregion + + //#region [ - InitializeService02Refrence() - ] + //public void InitializeService02Refrence() + //{ + // Ref_Service02 = new ExternalService.Service02(); + //} + //#endregion + + //#region [ - InitializeService03Refrence() - ] + //public void InitializeService03Refrence() + //{ + // Ref_Service03 = new ExternalService.Service03(); + //} + //#endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/B.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/B.cs new file mode 100644 index 0000000..f0f3531 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/B.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution01.LifeCycle +{ + public class B + { + #region [ - Ctor - ] + public B() + { + //Eager Composition + Ref_Service01 = new ExternalService.Service01(); + Ref_Service02 = new ExternalService.Service02(); + Ref_Service03 = new ExternalService.Service03(); + } + #endregion + + #region [ - Props - ] + public ExternalService.Service01 Ref_Service01 { get; set; } + public ExternalService.Service02 Ref_Service02 { get; set; } + public ExternalService.Service03 Ref_Service03 { get; set; } + #endregion + + #region [ - Methods - ] + + ////Lazy Composition: + + //#region [ - InitializeService01Refrence() - ] + + //public void InitializeService01Refrence() + //{ + // Ref_Service01 = new ExternalService.Service01(); + //} + //#endregion + + //#region [ - InitializeService02Refrence() - ] + //public void InitializeService02Refrence() + //{ + // Ref_Service02 = new ExternalService.Service02(); + //} + //#endregion + + //#region [ - InitializeService03Refrence() - ] + //public void InitializeService03Refrence() + //{ + // Ref_Service03 = new ExternalService.Service03(); + //} + //#endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/C.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/C.cs new file mode 100644 index 0000000..44b0705 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/LifeCycle/C.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution01.LifeCycle +{ + public class C + { + #region [ - Ctor - ] + public C() + { + //Eager Composition + Ref_Service01 = new ExternalService.Service01(); + Ref_Service02 = new ExternalService.Service02(); + Ref_Service03 = new ExternalService.Service03(); + } + #endregion + + #region [ - Props - ] + public ExternalService.Service01 Ref_Service01 { get; set; } + public ExternalService.Service02 Ref_Service02 { get; set; } + public ExternalService.Service03 Ref_Service03 { get; set; } + #endregion + + #region [ - Methods - ] + + ////Lazy Composition: + + //#region [ - InitializeService01Refrence() - ] + + //public void InitializeService01Refrence() + //{ + // Ref_Service01 = new ExternalService.Service01(); + //} + //#endregion + + //#region [ - InitializeService02Refrence() - ] + //public void InitializeService02Refrence() + //{ + // Ref_Service02 = new ExternalService.Service02(); + //} + //#endregion + + //#region [ - InitializeService03Refrence() - ] + //public void InitializeService03Refrence() + //{ + // Ref_Service03 = new ExternalService.Service03(); + //} + //#endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/Program.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/Program.cs new file mode 100644 index 0000000..d48b12e --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/Program.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution01 +{ + class Program + { + static void Main(string[] args) + { + LifeCycle.A Ref_A = new LifeCycle.A(new ExternalService.Service01(), + new ExternalService.Service02(), + new ExternalService.Service03()); + + LifeCycle.B Ref_B = new LifeCycle.B(); + + LifeCycle.C Ref_C = new LifeCycle.C(); + + + // Active + + #region [ - Eager Composition - ] + + Console.WriteLine("A:"); + Ref_A.Ref_Service01.M1(); + Ref_A.Ref_Service02.M2(); + Ref_A.Ref_Service03.M3(); + + Console.WriteLine("--------------"); + + Console.WriteLine("B:"); + Ref_B.Ref_Service01.M1(); + Ref_B.Ref_Service02.M2(); + Ref_B.Ref_Service03.M3(); + + Console.WriteLine("--------------"); + + Console.WriteLine("C:"); + Ref_C.Ref_Service01.M1(); + Ref_C.Ref_Service02.M2(); + Ref_C.Ref_Service03.M3(); + + #endregion + + + // Disable + + #region [ - Lazy Composition - ] + + //#region [ - A - ] + + //Console.WriteLine("A:"); + + //Ref_A.InitializeService01Refrence(); + //Ref_A.Ref_Service01.M1(); + + //Ref_A.InitializeService02Refrence(); + //Ref_A.Ref_Service02.M2(); + + //Ref_A.InitializeService03Refrence(); + //Ref_A.Ref_Service03.M3(); + + //#endregion + + //#region [ - B - ] + + //Console.WriteLine("B:"); + + //Ref_B.InitializeService01Refrence(); + //Ref_B.Ref_Service01.M1(); + + //Ref_B.InitializeService02Refrence(); + //Ref_B.Ref_Service02.M2(); + + //Ref_B.InitializeService03Refrence(); + //Ref_B.Ref_Service03.M3(); + + //#endregion + + //#region [ - C - ] + + //Console.WriteLine("C:"); + + //Ref_C.InitializeService01Refrence(); + //Ref_C.Ref_Service01.M1(); + + //Ref_C.InitializeService02Refrence(); + //Ref_C.Ref_Service02.M2(); + + //Ref_C.InitializeService03Refrence(); + //Ref_C.Ref_Service03.M3(); + + //#endregion + + #endregion + + + + System.Console.ReadLine(); + } + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/Properties/AssemblyInfo.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e4471b3 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DIP_Solution01")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DIP_Solution01")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0486b1d9-eafd-4449-b375-bcd2f2819933")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.exe new file mode 100644 index 0000000..61b4319 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.exe.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.pdb new file mode 100644 index 0000000..5b454a6 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/bin/Debug/DIP_Solution01.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.AssemblyReference.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.AssemblyReference.cache new file mode 100644 index 0000000..9dbe9c3 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.AssemblyReference.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.CoreCompileInputs.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..8e32f0d --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +bc14799579aaa2c0030d531b5cd699cc7d64e75d diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.FileListAbsolute.txt b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..d771037 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution01\bin\Debug\DIP_Solution01.exe.config +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution01\bin\Debug\DIP_Solution01.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution01\bin\Debug\DIP_Solution01.pdb +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution01\obj\Debug\DIP_Solution01.csproj.AssemblyReference.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution01\obj\Debug\DIP_Solution01.csproj.CoreCompileInputs.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution01\obj\Debug\DIP_Solution01.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution01\obj\Debug\DIP_Solution01.pdb diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.exe new file mode 100644 index 0000000..61b4319 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.pdb new file mode 100644 index 0000000..5b454a6 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DIP_Solution01.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..a31ab72 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution01/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/App.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/DIP_Solution02.csproj b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/DIP_Solution02.csproj new file mode 100644 index 0000000..d971f43 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/DIP_Solution02.csproj @@ -0,0 +1,60 @@ + + + + + Debug + AnyCPU + {FC515F23-9748-41B8-B33B-89BBAF4E8016} + Exe + DIP_Solution02 + DIP_Solution02 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service01.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service01.cs new file mode 100644 index 0000000..22c85e1 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service01.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution02.ExternalService +{ + public class Service01 + { + #region [ - Ctor - ] + public Service01() + { + + } + #endregion + + #region [ - Method - ] + public void M1() + { + Console.WriteLine("M1 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service02.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service02.cs new file mode 100644 index 0000000..ef9c8eb --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service02.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution02.ExternalService +{ + public class Service02 + { + #region [ - Ctor - ] + public Service02() + { + + } + #endregion + + #region [ - Method - ] + public void M2() + { + Console.WriteLine("M2 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service03.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service03.cs new file mode 100644 index 0000000..3ddd2b0 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/ExternalService/Service03.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution02.ExternalService +{ + public class Service03 + { + #region [ - Ctor - ] + public Service03() + { + + } + #endregion + + #region [ - Method - ] + public void M3() + { + Console.WriteLine("M3 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/A.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/A.cs new file mode 100644 index 0000000..d0bad62 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/A.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution02.LifeCycle +{ + public class A + { + #region [ - Ctor - ] + + #region [ - A(ExternalService.Service01 ref_Service01 ExternalService.Service02 ref_Service02 ExternalService.Service03 ref_Service03) - ] + + ////Eager Aggregation + + //public A(ExternalService.Service01 ref_Service01, + // ExternalService.Service02 ref_Service02, + // ExternalService.Service03 ref_Service03) + //{ + // Ref_Service01 = ref_Service01; + // Ref_Service02 = ref_Service02; + // Ref_Service03 = ref_Service03; + //} + + #endregion + + #region [ - A() - ] + + public A() + { + + } + + #endregion + + #endregion + + #region [ - Props - ] + public ExternalService.Service01 Ref_Service01 { get; set; } + public ExternalService.Service02 Ref_Service02 { get; set; } + public ExternalService.Service03 Ref_Service03 { get; set; } + #endregion + + #region [ - Methods - ] + + //Lazy Aggregation: + + #region [ - InitializeService01Refrence(ExternalService.Service01 ref_Service01) - ] + + public void InitializeService01Refrence(ExternalService.Service01 ref_Service01) + { + Ref_Service01 = ref_Service01; + } + #endregion + + #region [ - InitializeService02Refrence(ExternalService.Service02 ref_Service02) - ] + public void InitializeService02Refrence(ExternalService.Service02 ref_Service02) + { + Ref_Service02 = ref_Service02; + } + #endregion + + #region [ - InitializeService03Refrence(ExternalService.Service03 ref_Service03) - ] + public void InitializeService03Refrence(ExternalService.Service03 ref_Service03) + { + Ref_Service03 = ref_Service03; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/B.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/B.cs new file mode 100644 index 0000000..a489c30 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/B.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution02.LifeCycle +{ + public class B + { + #region [ - Ctor - ] + + #region [ - B(ExternalService.Service01 ref_Service01 ExternalService.Service02 ref_Service02 ExternalService.Service03 ref_Service03) - ] + + ////Eager Aggregation + + //public B(ExternalService.Service01 ref_Service01, + // ExternalService.Service02 ref_Service02, + // ExternalService.Service03 ref_Service03) + //{ + // Ref_Service01 = ref_Service01; + // Ref_Service02 = ref_Service02; + // Ref_Service03 = ref_Service03; + //} + + #endregion + + #region [ - B() - ] + + public B() + { + + } + + #endregion + + #endregion + + #region [ - Props - ] + public ExternalService.Service01 Ref_Service01 { get; set; } + public ExternalService.Service02 Ref_Service02 { get; set; } + public ExternalService.Service03 Ref_Service03 { get; set; } + #endregion + + #region [ - Methods - ] + + //Lazy Aggregation: + + #region [ - InitializeService01Refrence(ExternalService.Service01 ref_Service01) - ] + + public void InitializeService01Refrence(ExternalService.Service01 ref_Service01) + { + Ref_Service01 = ref_Service01; + } + #endregion + + #region [ - InitializeService02Refrence(ExternalService.Service02 ref_Service02) - ] + public void InitializeService02Refrence(ExternalService.Service02 ref_Service02) + { + Ref_Service02 = ref_Service02; + } + #endregion + + #region [ - InitializeService03Refrence(ExternalService.Service03 ref_Service03) - ] + public void InitializeService03Refrence(ExternalService.Service03 ref_Service03) + { + Ref_Service03 = ref_Service03; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/C.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/C.cs new file mode 100644 index 0000000..4e92694 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/LifeCycle/C.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution02.LifeCycle +{ + public class C + { + #region [ - Ctor - ] + + #region [ - C(ExternalService.Service01 ref_Service01 ExternalService.Service02 ref_Service02 ExternalService.Service03 ref_Service03) - ] + + ////Eager Aggregation + + //public C(ExternalService.Service01 ref_Service01, + // ExternalService.Service02 ref_Service02, + // ExternalService.Service03 ref_Service03) + //{ + // Ref_Service01 = ref_Service01; + // Ref_Service02 = ref_Service02; + // Ref_Service03 = ref_Service03; + //} + + #endregion + + #region [ - C() - ] + + public C() + { + + } + + #endregion + + #endregion + + #region [ - Props - ] + public ExternalService.Service01 Ref_Service01 { get; set; } + public ExternalService.Service02 Ref_Service02 { get; set; } + public ExternalService.Service03 Ref_Service03 { get; set; } + #endregion + + #region [ - Methods - ] + + //Lazy Aggregation: + + #region [ - InitializeService01Refrence(ExternalService.Service01 ref_Service01) - ] + + public void InitializeService01Refrence(ExternalService.Service01 ref_Service01) + { + Ref_Service01 = ref_Service01; + } + #endregion + + #region [ - InitializeService02Refrence(ExternalService.Service02 ref_Service02) - ] + public void InitializeService02Refrence(ExternalService.Service02 ref_Service02) + { + Ref_Service02 = ref_Service02; + } + #endregion + + #region [ - InitializeService03Refrence(ExternalService.Service03 ref_Service03) - ] + public void InitializeService03Refrence(ExternalService.Service03 ref_Service03) + { + Ref_Service03 = ref_Service03; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/Program.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/Program.cs new file mode 100644 index 0000000..ba42bde --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/Program.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution02 +{ + class Program + { + static void Main(string[] args) + { + LifeCycle.A Ref_A = new LifeCycle.A(); + + LifeCycle.B Ref_B = new LifeCycle.B(); + + LifeCycle.C Ref_C = new LifeCycle.C(); + + + // Disable + + #region [ - Eager Aggregation - ] + + //Console.WriteLine("A:"); + //Ref_A.Ref_Service01.M1(); + //Ref_A.Ref_Service02.M2(); + //Ref_A.Ref_Service03.M3(); + + //Console.WriteLine("--------------"); + + //Console.WriteLine("B:"); + //Ref_B.Ref_Service01.M1(); + //Ref_B.Ref_Service02.M2(); + //Ref_B.Ref_Service03.M3(); + + //Console.WriteLine("--------------"); + + //Console.WriteLine("C:"); + //Ref_C.Ref_Service01.M1(); + //Ref_C.Ref_Service02.M2(); + //Ref_C.Ref_Service03.M3(); + + #endregion + + + // Active + + #region [ - Lazy Aggregation - ] + + #region [ - A - ] + + Console.WriteLine("A:"); + + Ref_A.InitializeService01Refrence(new ExternalService.Service01()); + Ref_A.Ref_Service01.M1(); + + Ref_A.InitializeService02Refrence(new ExternalService.Service02()); + Ref_A.Ref_Service02.M2(); + + Ref_A.InitializeService03Refrence(new ExternalService.Service03()); + Ref_A.Ref_Service03.M3(); + + #endregion + + #region [ - B - ] + + Console.WriteLine("B:"); + + Ref_B.InitializeService01Refrence(new ExternalService.Service01()); + Ref_B.Ref_Service01.M1(); + + Ref_B.InitializeService02Refrence(new ExternalService.Service02()); + Ref_B.Ref_Service02.M2(); + + Ref_B.InitializeService03Refrence(new ExternalService.Service03()); + Ref_B.Ref_Service03.M3(); + + #endregion + + #region [ - C - ] + + Console.WriteLine("C:"); + + Ref_C.InitializeService01Refrence(new ExternalService.Service01()); + Ref_C.Ref_Service01.M1(); + + Ref_C.InitializeService02Refrence(new ExternalService.Service02()); + Ref_C.Ref_Service02.M2(); + + Ref_C.InitializeService03Refrence(new ExternalService.Service03()); + Ref_C.Ref_Service03.M3(); + + #endregion + + #endregion + + + + System.Console.ReadLine(); + } + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/Properties/AssemblyInfo.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a8d626f --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DIP_Solution02")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DIP_Solution02")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fc515f23-9748-41b8-b33b-89bbaf4e8016")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.exe new file mode 100644 index 0000000..51f95a5 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.exe.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.pdb new file mode 100644 index 0000000..e82e019 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/bin/Debug/DIP_Solution02.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.AssemblyReference.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.AssemblyReference.cache new file mode 100644 index 0000000..9dbe9c3 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.AssemblyReference.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.CoreCompileInputs.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..8e32f0d --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +bc14799579aaa2c0030d531b5cd699cc7d64e75d diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.FileListAbsolute.txt b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..dd3c9d1 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution02\bin\Debug\DIP_Solution02.exe.config +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution02\bin\Debug\DIP_Solution02.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution02\bin\Debug\DIP_Solution02.pdb +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution02\obj\Debug\DIP_Solution02.csproj.AssemblyReference.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution02\obj\Debug\DIP_Solution02.csproj.CoreCompileInputs.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution02\obj\Debug\DIP_Solution02.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution02\obj\Debug\DIP_Solution02.pdb diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.exe new file mode 100644 index 0000000..51f95a5 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.pdb new file mode 100644 index 0000000..e82e019 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DIP_Solution02.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..51e884b Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution02/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03.zip b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03.zip new file mode 100644 index 0000000..7807136 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03.zip differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/App.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/DIP_Solution03.csproj b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/DIP_Solution03.csproj new file mode 100644 index 0000000..9bdf0e0 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/DIP_Solution03.csproj @@ -0,0 +1,61 @@ + + + + + Debug + AnyCPU + {242554DD-3668-4227-B663-EAA6A6CF5A53} + Exe + DIP_Solution03 + DIP_Solution03 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service01.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service01.cs new file mode 100644 index 0000000..888a8fd --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service01.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution03.ExternalService +{ + public class Service01 + { + #region [ - Ctor - ] + public Service01() + { + + } + #endregion + + #region [ - Method - ] + public void M1() + { + Console.WriteLine("M1 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service02.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service02.cs new file mode 100644 index 0000000..af8ed34 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service02.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution03.ExternalService +{ + public class Service02 + { + #region [ - Ctor - ] + public Service02() + { + + } + #endregion + + #region [ - Method - ] + public void M2() + { + Console.WriteLine("M2 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service03.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service03.cs new file mode 100644 index 0000000..34136ee --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/ExternalService/Service03.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution03.ExternalService +{ + public class Service03 + { + #region [ - Ctor - ] + public Service03() + { + + } + #endregion + + #region [ - Method - ] + public void M3() + { + Console.WriteLine("M3 is running ..."); + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/A.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/A.cs new file mode 100644 index 0000000..3cfc5d5 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/A.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution03.LifeCycle +{ + public class A: Service + { + #region [ - Ctor - ] + public A(): base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03()) + { + + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/B.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/B.cs new file mode 100644 index 0000000..8413c9f --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/B.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution03.LifeCycle +{ + public class B: Service + { + #region [ - Ctor - ] + public B() : base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03()) + { + + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/C.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/C.cs new file mode 100644 index 0000000..0b45599 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/LifeCycle/C.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution03.LifeCycle +{ + public class C: Service + { + #region [ - Ctor - ] + public C() : base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03()) + { + + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Program.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Program.cs new file mode 100644 index 0000000..3477b92 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Program.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution03 +{ + class Program + { + static void Main(string[] args) + { + LifeCycle.A Ref_A = new LifeCycle.A(); + + LifeCycle.B Ref_B = new LifeCycle.B(); + + LifeCycle.C Ref_C = new LifeCycle.C(); + + + // Active + + #region [ - Eager Aggregation - ] + + Console.WriteLine("A:"); + Ref_A.Ref_Service01.M1(); + Ref_A.Ref_Service02.M2(); + Ref_A.Ref_Service03.M3(); + + Console.WriteLine("--------------"); + + Console.WriteLine("B:"); + Ref_B.Ref_Service01.M1(); + Ref_B.Ref_Service02.M2(); + Ref_B.Ref_Service03.M3(); + + Console.WriteLine("--------------"); + + Console.WriteLine("C:"); + Ref_C.Ref_Service01.M1(); + Ref_C.Ref_Service02.M2(); + Ref_C.Ref_Service03.M3(); + + #endregion + + + // Disable : Aggregation methods in Serveice are commented + + #region [ - Lazy Aggregation - ] + + //#region [ - A - ] + + //Console.WriteLine("A:"); + + //Ref_A.InitializeService01Refrence(new ExternalService.Service01()); + //Ref_A.Ref_Service01.M1(); + + //Ref_A.InitializeService02Refrence(new ExternalService.Service02()); + //Ref_A.Ref_Service02.M2(); + + //Ref_A.InitializeService03Refrence(new ExternalService.Service03()); + //Ref_A.Ref_Service03.M3(); + + //#endregion + + //Console.WriteLine("--------------"); + + //#region [ - B - ] + + //Console.WriteLine("B:"); + + //Ref_B.InitializeService01Refrence(new ExternalService.Service01()); + //Ref_B.Ref_Service01.M1(); + + //Ref_B.InitializeService02Refrence(new ExternalService.Service02()); + //Ref_B.Ref_Service02.M2(); + + //Ref_B.InitializeService03Refrence(new ExternalService.Service03()); + //Ref_B.Ref_Service03.M3(); + + //#endregion + + //Console.WriteLine("--------------"); + + //#region [ - C - ] + + //Console.WriteLine("C:"); + + //Ref_C.InitializeService01Refrence(new ExternalService.Service01()); + //Ref_C.Ref_Service01.M1(); + + //Ref_C.InitializeService02Refrence(new ExternalService.Service02()); + //Ref_C.Ref_Service02.M2(); + + //Ref_C.InitializeService03Refrence(new ExternalService.Service03()); + //Ref_C.Ref_Service03.M3(); + + //#endregion + + #endregion + + + + System.Console.ReadLine(); + } + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Properties/AssemblyInfo.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..30713b8 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DIP_Solution03")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DIP_Solution03")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("242554dd-3668-4227-b663-eaa6a6cf5a53")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Service.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Service.cs new file mode 100644 index 0000000..5deed54 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/Service.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution03 +{ + public class Service + { + #region [ - Ctor - ] + + #region [ - Service(ExternalService.Service01 ref_Service01, ExternalService.Service02 ref_Service02, ExternalService.Service03 ref_Service03) - ] + + // Eager Aggregation + + public Service(ExternalService.Service01 ref_Service01, + ExternalService.Service02 ref_Service02, + ExternalService.Service03 ref_Service03) + { + Ref_Service01 = ref_Service01; + Ref_Service02 = ref_Service02; + Ref_Service03 = ref_Service03; + } + + #endregion + + #region [ - Service() - ] + + public Service() + { + + } + #endregion + + #endregion + + #region [ - Props - ] + public ExternalService.Service01 Ref_Service01 { get; set; } + public ExternalService.Service02 Ref_Service02 { get; set; } + public ExternalService.Service03 Ref_Service03 { get; set; } + #endregion + + #region [ - Methods - ] + + ////Lazy Aggregation: + + //#region [ - InitializeService01Refrence(ExternalService.Service01 ref_Service01) - ] + + //public void InitializeService01Refrence(ExternalService.Service01 ref_Service01) + //{ + // Ref_Service01 = ref_Service01; + //} + //#endregion + + //#region [ - InitializeService02Refrence(ExternalService.Service02 ref_Service02) - ] + //public void InitializeService02Refrence(ExternalService.Service02 ref_Service02) + //{ + // Ref_Service02 = ref_Service02; + //} + //#endregion + + //#region [ - InitializeService03Refrence(ExternalService.Service03 ref_Service03) - ] + //public void InitializeService03Refrence(ExternalService.Service03 ref_Service03) + //{ + // Ref_Service03 = ref_Service03; + //} + //#endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.exe new file mode 100644 index 0000000..3cd8dfb Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.exe.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.pdb new file mode 100644 index 0000000..70ec516 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/bin/Debug/DIP_Solution03.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.AssemblyReference.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.AssemblyReference.cache new file mode 100644 index 0000000..9dbe9c3 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.AssemblyReference.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.CoreCompileInputs.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..e099013 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +cea1fc0e6df5af2bbcaf0de8940de2f746904f4c diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.FileListAbsolute.txt b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..a202676 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution03\bin\Debug\DIP_Solution03.exe.config +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution03\bin\Debug\DIP_Solution03.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution03\bin\Debug\DIP_Solution03.pdb +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution03\obj\Debug\DIP_Solution03.csproj.AssemblyReference.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution03\obj\Debug\DIP_Solution03.csproj.CoreCompileInputs.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution03\obj\Debug\DIP_Solution03.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution03\obj\Debug\DIP_Solution03.pdb diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.exe new file mode 100644 index 0000000..3cd8dfb Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.pdb new file mode 100644 index 0000000..70ec516 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DIP_Solution03.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..da58c42 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution03/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/App.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/DIP_Solution04.csproj b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/DIP_Solution04.csproj new file mode 100644 index 0000000..963286e --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/DIP_Solution04.csproj @@ -0,0 +1,62 @@ + + + + + Debug + AnyCPU + {8DDB2F59-34EA-4008-A736-612FCF6F5EDD} + Exe + DIP_Solution04 + DIP_Solution04 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service01.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service01.cs new file mode 100644 index 0000000..6f43650 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service01.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04.ExternalService +{ + public class Service01 + { + #region [ - Ctor - ] + public Service01() + { + + } + #endregion + + #region [ - Method - ] + + #region [ - M1() - ] + public void M1() + { + Console.WriteLine("M1 is running ..."); + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service02.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service02.cs new file mode 100644 index 0000000..07aadd0 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service02.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04.ExternalService +{ + public class Service02 + { + #region [ - Ctor - ] + public Service02() + { + + } + #endregion + + #region [ - Method - ] + + #region [ - M2() - ] + public void M2() + { + Console.WriteLine("M2 is running ..."); + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service03.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service03.cs new file mode 100644 index 0000000..2f7f5d1 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/ExternalService/Service03.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04.ExternalService +{ + public class Service03 + { + #region [ - Ctor - ] + public Service03() + { + + } + #endregion + + #region [ - Method - ] + + #region [ - M3() - ] + public void M3() + { + Console.WriteLine("M3 is running ..."); + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Framework/Base/BaseService.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Framework/Base/BaseService.cs new file mode 100644 index 0000000..ef4c48a --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Framework/Base/BaseService.cs @@ -0,0 +1,68 @@ +using DIP_Solution04.ExternalService; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04.Framework.Base +{ + public class BaseService : Interface.IService + { + #region [ - Ctor - ] + + #region [ - BaseService(ExternalService.Service01 ref_Service01, ExternalService.Service02 ref_Service02, ExternalService.Service03 ref_Service03) - ] + //Eager Aggregation + public BaseService(Service01 ref_Service01, + Service02 ref_Service02, + Service03 ref_Service03) + { + Ref_Service01 = ref_Service01; + Ref_Service02 = ref_Service02; + Ref_Service03 = ref_Service03; + } + #endregion + + #region [ - BaseService() - ] + public BaseService() + { + + } + #endregion + + #endregion + + #region [ - Props - ] + public Service01 Ref_Service01 { get; set; } + public Service02 Ref_Service02 { get; set; } + public Service03 Ref_Service03 { get; set; } + #endregion + + #region [ - Methods - ] + + // Implement Lazy Aggregation + + #region [ - GenerateService01(Service01 ref_Service01) - ] + public void GenerateService01(Service01 ref_Service01) + { + Ref_Service01 = ref_Service01; + } + #endregion + + #region [ - GenerateService02(Service02 ref_Service02) - ] + public void GenerateService02(Service02 ref_Service02) + { + Ref_Service02 = ref_Service02; + } + #endregion + + #region [ - GenerateService03(Service03 ref_Service03) - ] + public void GenerateService03(Service03 ref_Service03) + { + Ref_Service03 = ref_Service03; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Framework/Interface/IService.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Framework/Interface/IService.cs new file mode 100644 index 0000000..37760cf --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Framework/Interface/IService.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04.Framework.Interface +{ + interface IService + { + #region [ - Props - ] + ExternalService.Service01 Ref_Service01{ get; set; } + ExternalService.Service02 Ref_Service02{ get; set; } + ExternalService.Service03 Ref_Service03{ get; set; } + #endregion + + #region [ - Methods - ] + + #region [ - GenerateService01(ExternalService.Service01 ref_Service01) - ] + void GenerateService01(ExternalService.Service01 ref_Service01); + #endregion + + #region [ - GenerateService02(ExternalService.Service02 ref_Service02) - ] + void GenerateService02(ExternalService.Service02 ref_Service02); + #endregion + + #region [ - GenerateService03(ExternalService.Service03 ref_Service03) - ] + void GenerateService03(ExternalService.Service03 ref_Service03); + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/A.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/A.cs new file mode 100644 index 0000000..2acd714 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/A.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04.LifeCycle +{ + public class A: Framework.Base.BaseService + { + #region [ - Ctor - ] + public A(): base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03()) + { + + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/B.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/B.cs new file mode 100644 index 0000000..5848072 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/B.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04.LifeCycle +{ + public class B: Framework.Base.BaseService + { + #region [ - Ctor - ] + public B() : base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03()) + { + + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/C.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/C.cs new file mode 100644 index 0000000..81218aa --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/LifeCycle/C.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04.LifeCycle +{ + public class C: Framework.Base.BaseService + { + #region [ - Ctor - ] + public C() : base(new ExternalService.Service01(), new ExternalService.Service02(), new ExternalService.Service03()) + { + + } + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Program.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Program.cs new file mode 100644 index 0000000..668cfe4 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Program.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution04 +{ + class Program + { + static void Main(string[] args) + { + LifeCycle.A Ref_A = new LifeCycle.A(); + + LifeCycle.B Ref_B = new LifeCycle.B(); + + LifeCycle.C Ref_C = new LifeCycle.C(); + + // Disable + + #region [ - Eager Aggregation - ] + + //Console.WriteLine("A:"); + //Ref_A.Ref_Service01.M1(); + //Ref_A.Ref_Service02.M2(); + //Ref_A.Ref_Service03.M3(); + + //Console.WriteLine("--------------"); + + //Console.WriteLine("B:"); + //Ref_B.Ref_Service01.M1(); + //Ref_B.Ref_Service02.M2(); + //Ref_B.Ref_Service03.M3(); + + //Console.WriteLine("--------------"); + + //Console.WriteLine("C:"); + //Ref_C.Ref_Service01.M1(); + //Ref_C.Ref_Service02.M2(); + //Ref_C.Ref_Service03.M3(); + + #endregion + + + // Active + + #region [ - Lazy Aggregation - ] + + #region [ - A - ] + + Console.WriteLine("A:"); + + Ref_A.GenerateService01(new ExternalService.Service01()); + Ref_A.Ref_Service01.M1(); + + Ref_A.GenerateService02(new ExternalService.Service02()); + Ref_A.Ref_Service02.M2(); + + Ref_A.GenerateService03(new ExternalService.Service03()); + Ref_A.Ref_Service03.M3(); + + #endregion + + Console.WriteLine("--------------"); + + #region [ - B - ] + + Console.WriteLine("B:"); + + Ref_B.GenerateService01(new ExternalService.Service01()); + Ref_B.Ref_Service01.M1(); + + Ref_B.GenerateService02(new ExternalService.Service02()); + Ref_B.Ref_Service02.M2(); + + Ref_B.GenerateService03(new ExternalService.Service03()); + Ref_B.Ref_Service03.M3(); + + #endregion + + Console.WriteLine("--------------"); + + #region [ - C - ] + + Console.WriteLine("C:"); + + Ref_C.GenerateService01(new ExternalService.Service01()); + Ref_C.Ref_Service01.M1(); + + Ref_C.GenerateService02(new ExternalService.Service02()); + Ref_C.Ref_Service02.M2(); + + Ref_C.GenerateService03(new ExternalService.Service03()); + Ref_C.Ref_Service03.M3(); + + #endregion + + #endregion + + + + System.Console.ReadLine(); + } + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Properties/AssemblyInfo.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f684cb8 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DIP_Solution04")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DIP_Solution04")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8ddb2f59-34ea-4008-a736-612fcf6f5edd")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.exe new file mode 100644 index 0000000..16ba23f Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.exe.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.pdb new file mode 100644 index 0000000..9f00c83 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/bin/Debug/DIP_Solution04.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.AssemblyReference.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.AssemblyReference.cache new file mode 100644 index 0000000..9dbe9c3 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.AssemblyReference.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.CoreCompileInputs.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..bc3f2c7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +d68365b161194bf2db16706aba6cc2d2f704eecc92f60bbead37d172ee57baa7 diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.FileListAbsolute.txt b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..6399ca3 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.csproj.FileListAbsolute.txt @@ -0,0 +1,11 @@ +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\bin\Debug\DIP_Solution04.exe.config +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\bin\Debug\DIP_Solution04.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\bin\Debug\DIP_Solution04.pdb +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.csproj.AssemblyReference.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.csproj.CoreCompileInputs.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.pdb +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.csproj.AssemblyReference.cache +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.csproj.CoreCompileInputs.cache +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.exe +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution04\obj\Debug\DIP_Solution04.pdb diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.exe new file mode 100644 index 0000000..16ba23f Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.pdb new file mode 100644 index 0000000..9f00c83 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DIP_Solution04.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..22391a0 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution04/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/App.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/DIP_Solution05.csproj b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/DIP_Solution05.csproj new file mode 100644 index 0000000..51cbb12 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/DIP_Solution05.csproj @@ -0,0 +1,62 @@ + + + + + Debug + AnyCPU + {BC5774AA-BBB0-4474-ADE6-00C748D812A9} + Exe + DIP_Solution05 + DIP_Solution05 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service01.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service01.cs new file mode 100644 index 0000000..2c06c7a --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service01.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05.ExternalService +{ + public class Service01: Framework.Base.BaseService + { + #region [ - Ctor - ] + public Service01() + { + + } + #endregion + + #region [ - Method - ] + + #region [ - M1() - ] + public override void M1() + { + Console.WriteLine("M1 is running ..."); + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service02.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service02.cs new file mode 100644 index 0000000..018a3f6 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service02.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05.ExternalService +{ + public class Service02: Framework.Base.BaseService + { + #region [ - Ctor - ] + public Service02() + { + + } + #endregion + + #region [ - Method - ] + + #region [ - M2() - ] + public override void M2() + { + Console.WriteLine("M2 is running ..."); + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service03.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service03.cs new file mode 100644 index 0000000..d1403e4 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/ExternalService/Service03.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05.ExternalService +{ + public class Service03 : Framework.Base.BaseService + { + #region [ - Ctor - ] + public Service03() + { + + } + #endregion + + #region [ - Method - ] + + #region [ - M3() - ] + public override void M3() + { + Console.WriteLine("M3 is running ..."); + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Framework/Base/BaseService.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Framework/Base/BaseService.cs new file mode 100644 index 0000000..fec4d22 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Framework/Base/BaseService.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05.Framework.Base +{ + public class BaseService : Interface.IService + { + #region [ - Ctor - ] + public BaseService() + { + + } + #endregion + + #region [ - Methods - ] + + #region [ - M1() - ] + public virtual void M1() + { + throw new NotImplementedException(); + } + #endregion + + #region [ - M2() - ] + public virtual void M2() + { + throw new NotImplementedException(); + } + #endregion + + #region [ - M3() - ] + public virtual void M3() + { + throw new NotImplementedException(); + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Framework/Interface/IService.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Framework/Interface/IService.cs new file mode 100644 index 0000000..36575d3 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Framework/Interface/IService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05.Framework.Interface +{ + public interface IService + { + #region [ - Methods - ] + void M1(); + void M2(); + void M3(); + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/A.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/A.cs new file mode 100644 index 0000000..9d6395a --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/A.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05.LifeCycle +{ + public class A + { + #region [ - Ctor - ] + + #region [ - A(Framework.Interface.IService ref_IService) - ] + // Eager Aggregation + public A(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #region [ - A() - ] + public A() + { + + } + #endregion + + #endregion + + #region [ - Prop - ] + public Framework.Interface.IService Ref_IService { get; set; } + #endregion + + #region [ - Method - ] + + #region [ - InitializeIServiceRefrence(Framework.Interface.IService ref_IService) - ] + // Lazy Aggregation + public void InitializeIServiceRefrence(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/B.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/B.cs new file mode 100644 index 0000000..93d2cb5 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/B.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05.LifeCycle +{ + public class B + { + #region [ - Ctor - ] + + #region [ - B(Framework.Interface.IService ref_IService) - ] + // Eager Aggregation + public B(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #region [ - A() - ] + public B() + { + + } + #endregion + + #endregion + + #region [ - Prop - ] + public Framework.Interface.IService Ref_IService { get; set; } + #endregion + + #region [ - Method - ] + + #region [ - InitializeIServiceRefrence(Framework.Interface.IService ref_IService) - ] + // Lazy Aggregation + public void InitializeIServiceRefrence(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/C.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/C.cs new file mode 100644 index 0000000..2358023 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/LifeCycle/C.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05.LifeCycle +{ + public class C + { + #region [ - Ctor - ] + + #region [ - C(Framework.Interface.IService ref_IService) - ] + // Eager Aggregation + public C(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #region [ - C() - ] + public C() + { + + } + #endregion + + #endregion + + #region [ - Prop - ] + public Framework.Interface.IService Ref_IService { get; set; } + #endregion + + #region [ - Method - ] + + #region [ - InitializeIServiceRefrence(Framework.Interface.IService ref_IService) - ] + // Lazy Aggregation + public void InitializeIServiceRefrence(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Program.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Program.cs new file mode 100644 index 0000000..a28a7b3 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Program.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DIP_Solution05 +{ + class Program + { + static void Main(string[] args) + { + #region [ - Eager Aggregation - ] + + Console.WriteLine("| Eager Aggregation :"); + + #region [ - A - ] + Console.WriteLine("A:"); + + LifeCycle.A Ref_A_1 = new LifeCycle.A(new ExternalService.Service01()); // LSP + Ref_A_1.Ref_IService.M1(); + + LifeCycle.A Ref_A_2 = new LifeCycle.A(new ExternalService.Service02()); + Ref_A_2.Ref_IService.M2(); + + LifeCycle.A Ref_A_3 = new LifeCycle.A(new ExternalService.Service03()); + Ref_A_3.Ref_IService.M3(); + #endregion + + Console.WriteLine("--------------"); + + #region [ - B - ] + Console.WriteLine("B:"); + + LifeCycle.B Ref_B_1 = new LifeCycle.B(new ExternalService.Service01()); + Ref_B_1.Ref_IService.M1(); + + LifeCycle.B Ref_B_2 = new LifeCycle.B(new ExternalService.Service02()); + Ref_B_2.Ref_IService.M2(); + + LifeCycle.B Ref_B_3 = new LifeCycle.B(new ExternalService.Service03()); + Ref_B_3.Ref_IService.M3(); + #endregion + + Console.WriteLine("--------------"); + + #region [ - C - ] + Console.WriteLine("C:"); + + LifeCycle.C Ref_C_1 = new LifeCycle.C(new ExternalService.Service01()); + Ref_C_1.Ref_IService.M1(); + + LifeCycle.C Ref_C_2 = new LifeCycle.C(new ExternalService.Service02()); + Ref_C_2.Ref_IService.M2(); + + LifeCycle.C Ref_C_3 = new LifeCycle.C(new ExternalService.Service03()); + Ref_C_3.Ref_IService.M3(); + #endregion + + #endregion + + Console.WriteLine("----------------------------"); + + #region [ - Lazy Aggregation - ] + + Console.WriteLine("| Lazy Aggregation :"); + + #region [ - A - ] + Console.WriteLine("A:"); + + LifeCycle.A Ref_A_4 = new LifeCycle.A(); + Ref_A_4.InitializeIServiceRefrence(new ExternalService.Service01()); + Ref_A_4.Ref_IService.M1(); + + LifeCycle.A Ref_A_5 = new LifeCycle.A(); + Ref_A_5.InitializeIServiceRefrence(new ExternalService.Service02()); + Ref_A_5.Ref_IService.M2(); + + LifeCycle.A Ref_A_6 = new LifeCycle.A(); + Ref_A_6.InitializeIServiceRefrence(new ExternalService.Service03()); + Ref_A_6.Ref_IService.M3(); + #endregion + + Console.WriteLine("--------------"); + + #region [ - B - ] + Console.WriteLine("B:"); + + LifeCycle.B Ref_B_4 = new LifeCycle.B(); + Ref_B_4.InitializeIServiceRefrence(new ExternalService.Service01()); + Ref_B_4.Ref_IService.M1(); + + LifeCycle.B Ref_B_5 = new LifeCycle.B(); + Ref_B_5.InitializeIServiceRefrence(new ExternalService.Service02()); + Ref_B_5.Ref_IService.M2(); + + LifeCycle.B Ref_B_6 = new LifeCycle.B(); + Ref_B_6.InitializeIServiceRefrence(new ExternalService.Service03()); + Ref_B_6.Ref_IService.M3(); + #endregion + + Console.WriteLine("--------------"); + + #region [ - C - ] + Console.WriteLine("C:"); + + LifeCycle.C Ref_C_4 = new LifeCycle.C(); + Ref_C_4.InitializeIServiceRefrence(new ExternalService.Service01()); + Ref_C_4.Ref_IService.M1(); + + LifeCycle.C Ref_C_5 = new LifeCycle.C(); + Ref_C_5.InitializeIServiceRefrence(new ExternalService.Service02()); + Ref_C_5.Ref_IService.M2(); + + LifeCycle.C Ref_C_6 = new LifeCycle.C(); + Ref_C_6.InitializeIServiceRefrence(new ExternalService.Service03()); + Ref_C_6.Ref_IService.M3(); + #endregion + + #endregion + + Console.ReadLine(); + } + } +} diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Properties/AssemblyInfo.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..86b8b71 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DIP_Solution05")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DIP_Solution05")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bc5774aa-bbb0-4474-ade6-00c748d812a9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.exe new file mode 100644 index 0000000..5654214 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.exe.config b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.pdb new file mode 100644 index 0000000..5d5883e Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/bin/Debug/DIP_Solution05.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.AssemblyReference.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.AssemblyReference.cache new file mode 100644 index 0000000..9dbe9c3 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.AssemblyReference.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.CoreCompileInputs.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..4575c62 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +14a82008596b4dfd9c417b67514f5c76a7e975ef diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.FileListAbsolute.txt b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..3e021d0 --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution05\obj\Debug\DIP_Solution05.csproj.AssemblyReference.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution05\obj\Debug\DIP_Solution05.csproj.CoreCompileInputs.cache +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution05\bin\Debug\DIP_Solution05.exe.config +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution05\bin\Debug\DIP_Solution05.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution05\bin\Debug\DIP_Solution05.pdb +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution05\obj\Debug\DIP_Solution05.exe +E:\Ali\Programming\ASP.net\Projects\H\Session07\Session07\Session07\DIP_Solution05\obj\Debug\DIP_Solution05.pdb +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution05\bin\Debug\DIP_Solution05.exe.config +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution05\bin\Debug\DIP_Solution05.exe +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution05\bin\Debug\DIP_Solution05.pdb +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution05\obj\Debug\DIP_Solution05.csproj.AssemblyReference.cache +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution05\obj\Debug\DIP_Solution05.csproj.CoreCompileInputs.cache +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution05\obj\Debug\DIP_Solution05.exe +E:\Ali\Programming\ASP.net\MFT\Projects\H\Session07\Session07\Session07\DIP_Solution05\obj\Debug\DIP_Solution05.pdb diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.exe b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.exe new file mode 100644 index 0000000..5654214 Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.exe differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.pdb b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.pdb new file mode 100644 index 0000000..5d5883e Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DIP_Solution05.pdb differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..3a4cc9c Binary files /dev/null and b/Sessions/DILastSession/ALI_Session07/Session07/Session07/DIP_Solution05/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Sessions/DILastSession/ALI_Session07/Session07/Session07/Session07.sln b/Sessions/DILastSession/ALI_Session07/Session07/Session07/Session07.sln new file mode 100644 index 0000000..db7673b --- /dev/null +++ b/Sessions/DILastSession/ALI_Session07/Session07/Session07/Session07.sln @@ -0,0 +1,49 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31402.337 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DIP_Solution01", "DIP_Solution01\DIP_Solution01.csproj", "{0486B1D9-EAFD-4449-B375-BCD2F2819933}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DIP_Solution02", "DIP_Solution02\DIP_Solution02.csproj", "{FC515F23-9748-41B8-B33B-89BBAF4E8016}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DIP_Solution03", "DIP_Solution03\DIP_Solution03.csproj", "{242554DD-3668-4227-B663-EAA6A6CF5A53}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DIP_Solution04", "DIP_Solution04\DIP_Solution04.csproj", "{8DDB2F59-34EA-4008-A736-612FCF6F5EDD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DIP_Solution05", "DIP_Solution05\DIP_Solution05.csproj", "{BC5774AA-BBB0-4474-ADE6-00C748D812A9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0486B1D9-EAFD-4449-B375-BCD2F2819933}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0486B1D9-EAFD-4449-B375-BCD2F2819933}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0486B1D9-EAFD-4449-B375-BCD2F2819933}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0486B1D9-EAFD-4449-B375-BCD2F2819933}.Release|Any CPU.Build.0 = Release|Any CPU + {FC515F23-9748-41B8-B33B-89BBAF4E8016}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC515F23-9748-41B8-B33B-89BBAF4E8016}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC515F23-9748-41B8-B33B-89BBAF4E8016}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC515F23-9748-41B8-B33B-89BBAF4E8016}.Release|Any CPU.Build.0 = Release|Any CPU + {242554DD-3668-4227-B663-EAA6A6CF5A53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {242554DD-3668-4227-B663-EAA6A6CF5A53}.Debug|Any CPU.Build.0 = Debug|Any CPU + {242554DD-3668-4227-B663-EAA6A6CF5A53}.Release|Any CPU.ActiveCfg = Release|Any CPU + {242554DD-3668-4227-B663-EAA6A6CF5A53}.Release|Any CPU.Build.0 = Release|Any CPU + {8DDB2F59-34EA-4008-A736-612FCF6F5EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8DDB2F59-34EA-4008-A736-612FCF6F5EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8DDB2F59-34EA-4008-A736-612FCF6F5EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8DDB2F59-34EA-4008-A736-612FCF6F5EDD}.Release|Any CPU.Build.0 = Release|Any CPU + {BC5774AA-BBB0-4474-ADE6-00C748D812A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC5774AA-BBB0-4474-ADE6-00C748D812A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC5774AA-BBB0-4474-ADE6-00C748D812A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC5774AA-BBB0-4474-ADE6-00C748D812A9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0E1C482B-757F-44F2-81AB-9CE70355C1B9} + EndGlobalSection +EndGlobal diff --git a/Sessions/DILastSession/DILastSession.md b/Sessions/DILastSession/DILastSession.md new file mode 100644 index 0000000..e30c90b --- /dev/null +++ b/Sessions/DILastSession/DILastSession.md @@ -0,0 +1,215 @@ +# Dependency injection +Dependency injection is a technique used in object-oriented programming ([OOP](https://www.techtarget.com/searchapparchitecture/definition/object-oriented-programming-OOP)) to reduce the hardcoded dependencies between objects. A dependency in this context refers to a piece of [code](https://www.techtarget.com/whatis/definition/code) that relies on another resource to carry out its intended function. Often, that resource is a different object in the same application. + +Dependencies within an OOP application enable objects to perform their assigned tasks by providing additional functionality. For example, an application might include two class definitions: Class A and Class B. As part of its definition, Class B creates an instance of Class A to carry out a specific task, which means that Class B is dependent on Class A to carry out its function. The dependency is hardcoded into the Class B definition, resulting in code that is tightly coupled. Such code is more difficult to test, modify or reuse than [loosely coupled](https://www.techtarget.com/searchnetworking/definition/loose-coupling) code. + +Instead of the dependency being hardcoded, it can be injected through a mechanism such as a class constructor or public property. In this scenario, Class A gets passed into Class B via a parameter, rather than Class B creating the object itself. Class B can then be compiled without including the entire Class A definition, resulting in a class that functions independently of its dependencies. The result is code that is more readable, maintainable, testable, reusable and flexible than tightly coupled code. + +Dependency inversion is of particular importance when it comes to dependency injection. Dependency inversion focuses on decoupling and [abstracting](https://www.techtarget.com/whatis/definition/abstraction) code, rather than relying too heavily on concretions, which are hardcoded concrete implementations. Dependency inversion also ensures that high-level modules do not depend on low-level modules. + +Dependency injection supports the dependency inversion principle by [injecting dependencies into the class definitions](https://www.theserverside.com/video/Dependency-injection-in-Spring) instead of hardcoding them. In this way, it abstracts the details and ensures that high-level modules don't depend on low-level modules. + +1. **Service.** A class that carries out some type of functionality. Any object can be either a service or client. Which one it is depends on the role the object has in a particular injection. +2. **Client.** A class that requests something from a service. A client can be any class that uses a service. +3. **Interface.** A component implemented by a service for use by one or more clients. The component enables the client to access the service's functions, while abstracting the details of about how the service implements those functions, thus breaking dependencies between lower and higher classes. +4. **Injector.** A component that introduces a service to a client. The injector creates a service instance and then inserts the service into a client. The injector can be many objects working together. + + +## Advantages of dependency injection + +Many development teams use dependency injection because it offers several important benefits: + +- Code modules do not need to instantiate references to resources, and dependencies can be easily swapped out, even mock dependencies. By enabling the framework to do the resource creation, configuration data is centralized, and updates occur only in one place. +- Injected resources can be customized through [Extensible Markup Language](https://www.techtarget.com/whatis/definition/XML-Extensible-Markup-Language) files outside the source code. This enables changes to be applied without having to recompile the entire codebase. +- Programs are more testable, maintainable and reusable because the client classes do not need to know how dependencies are implemented. +- Developers working on the same application can build classes independently of each other because they only need to know how to use the interfaces to the referenced classes, not the workings of the classes themselves. +- Dependency injection helps in [unit testing](https://www.techtarget.com/searchsoftwarequality/definition/unit-testing) because configuration details can be saved to configuration files. This also enables the system to be reconfigured without recompiling. + +## Disadvantages of dependency injection + +Although dependency injection can be beneficial, it also comes with several challenges: + +- Dependency injection makes troubleshooting difficult because much of the code is pushed into an unknown location that creates resources and distributes them as needed across the application. +- Debugging code when misbehaving objects are buried in a complicated third-party framework can be frustrating and time-consuming. +- Dependency injection can slow integrated development environment automation, as dependency injection frameworks use either reflection or dynamic programming. + + +## Types of dependency injection + +OOP supports the following [approaches to dependency injection](https://www.theserverside.com/video/Constructor-injection-vs-setter-injection-in-Spring-Boot?_gl=1*j2jgxa*_ga*Njg3MzcwOTcxLjE3MzA4NzQxNjM.*_ga_TQKE4GS5P9*MTczOTM1NTQ2NS45LjEuMTczOTM1NTUxOS4wLjAuMA..): + +- **Constructor injection.** An injector uses a class constructor to inject the dependency. The referenced object is passed in as a parameter to the constructor. +- **Setter (property) injection.** The client exposes a setter method that the injector uses to pass in the dependency. +- **Method injection.** A client class is used to implement an interface. A [method](https://www.techtarget.com/whatis/definition/method) then provides the dependency, and an injector uses the interface to supply the dependency to the class. +- **Interface injection.** An injector method, provided by a dependency, injects the dependency into another client. Clients then need to implement an interface that uses a setter method to accept the dependency. + + +https://stackoverflow.com/questions/130794/what-is-dependency-injection + + + + +# EF Core +## Entity Framework Features + +- **Cross-platform:** EF Core is a cross-platform framework which can run on Windows, Linux and Mac. +- **Modelling:** EF (Entity Framework) creates an EDM (Entity Data Model) based on POCO (Plain Old CLR Object) entities with get/set properties of different data types. It uses this model when querying or saving entity data to the underlying database. +- **Querying:** EF allows us to use LINQ queries (C#/VB.NET) to retrieve data from the underlying database. The database provider will translate this LINQ queries to the database-specific query language (e.g. SQL for a relational database). EF also allows us to execute raw SQL queries directly to the database. +- **Change Tracking:** EF keeps track of changes occurred to instances of your entities (Property values) which need to be submitted to the database. +- **Saving:** EF executes INSERT, UPDATE, and DELETE commands to the database based on the changes occurred to your entities when you call the `SaveChanges()` method. EF also provides the asynchronous `SaveChangesAsync()` method. +- **Concurrency:** EF uses Optimistic Concurrency by default to protect overwriting changes made by another user since data was fetched from the database. +- **Transactions:** EF performs automatic transaction management while querying or saving data. It also provides options to customize transaction management. +- **Caching:** EF includes first level of caching out of the box. So, repeated querying will return data from the cache instead of hitting the database. +- **Built-in Conventions:** EF follows conventions over the configuration programming pattern, and includes a set of default rules which automatically configure the EF model. +- **Configurations:** EF allows us to configure the EF model by using data annotation attributes or Fluent API to override default conventions. +- **Migrations:** EF provides a set of migration commands that can be executed on the NuGet Package Manager Console or the Command Line Interface to create or manage underlying database Schema. + +https://stackoverflow.com/questions/3058/what-is-inversion-of-control + +https://www.freecodecamp.org/news/a-quick-intro-to-dependency-injection-what-it-is-and-when-to-use-it-7578c84fa88f/ + + +# Why use abstract class in the examples? + + +## **1. Scenario Overview** + +Let’s say we have an interface `IService`, and three different classes (`ServiceA`, `ServiceB`, `ServiceC`) that share common functionality. + +### **Approach 1: Each Class Implements the Interface Directly** +![[Pasted image 20250212171204.png]] +Each class provides its own implementation of `Execute()`. **No shared code exists among them**. + +--- + +### **Approach 2: Using an Abstract Base Class** + +If there’s common functionality across `ServiceA`, `ServiceB`, and `ServiceC`, we can introduce an **abstract class**: + + +```c# +public interface IService +{ + void Execute(); +} + +public abstract class BaseService : IService +{ + public void Log() => Console.WriteLine("Logging action"); // Common functionality + + public abstract void Execute(); // Forces derived classes to implement this +} + +public class ServiceA : BaseService +{ + public override void Execute() + { + Log(); + Console.WriteLine("Executing Service A"); + } +} + +public class ServiceB : BaseService +{ + public override void Execute() + { + Log(); + Console.WriteLine("Executing Service B"); + } +} + +public class ServiceC : BaseService +{ + public override void Execute() + { + Log(); + Console.WriteLine("Executing Service C"); + } +} +``` + +Here, `BaseService` provides **shared functionality** (e.g., `Log()`) so that `ServiceA`, `ServiceB`, and `ServiceC` don’t have to repeat the same logic. + +--- + +## **2. Comprehensive Comparison** + +| Feature | Interface Only | Abstract Base Class | +| -------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| **Forces contract adherence** | ✅ Yes, all classes must implement the methods | ✅ Yes, but can provide default behavior | +| **Allows multiple inheritance** | ✅ Yes (C# supports multiple interfaces) | ❌ No (C# doesn’t support multiple inheritance for classes) | +| **Allows shared implementation** | ❌ No, each class must provide its own implementation | ✅ Yes, common functionality can be placed in the base class | +| **Flexibility** | ✅ More flexible; any class can implement it without worrying about a base class | ❌ Less flexible; forces all classes to derive from the base class | +| **Scalability** | ✅ Easy to scale and extend | ✅ Good if many classes share behavior | +| **Testability** | ✅ Can be mocked easily | ✅ Can be mocked, but harder if logic is mixed | +| **Encapsulation** | ❌ No default behavior | ✅ Can provide reusable, hidden logic | +| **Dependency Injection (DI)** | ✅ Works well with DI | ✅ Works well, but makes DI a little more complex if constructor logic exists | + +--- + +## **3. When to Use Each Approach** + +### **Use Only Interfaces When:** + +✔️ **You need maximum flexibility** – Any class can implement `IService` without being tied to a base class. +✔️ **Each class has very different implementations** – If `ServiceA`, `ServiceB`, and `ServiceC` have nothing in common besides the method signature. +✔️ **You might need multiple inheritance** – Since C# **doesn’t support multiple class inheritance**, an interface allows a class to implement multiple behaviors. +✔️ **You’re focusing on dependency inversion** – Interfaces work well with DI and keep components loosely coupled. + +### **Use an Abstract Base Class When:** + +✔️ **There’s shared behavior across implementations** – If all service classes require a `Log()` method or any other common logic. +✔️ **You want partial implementation** – The base class can implement default behavior while forcing subclasses to implement required methods. +✔️ **The hierarchy makes sense logically** – If all services are conceptually similar and should extend a base class. +✔️ **You want to reduce code duplication** – The base class can contain reusable logic. + +--- + +## **4. Hybrid Approach: Combining Both** + +Sometimes, you might **use both an interface and an abstract class** for more flexibility: + +csharp + +CopyEdit + +```c# +public interface IService +{ + void Execute(); +} + +public abstract class BaseService : IService +{ + public void Log() => Console.WriteLine("Logging action"); + + public abstract void Execute(); +} + +public class ServiceA : BaseService +{ + public override void Execute() + { + Log(); + Console.WriteLine("Executing Service A"); + } +} +``` + +This way: + +- Clients can depend on **IService** (for DI flexibility). +- `BaseService` provides common behavior **without enforcing its use**. + +--- + +## **5. Conclusion** + +- ✅ **Use interfaces** when **flexibility and loose coupling** are most important. +- ✅ **Use abstract classes** when **code reuse and a shared structure** are beneficial. +- ✅ **Use both** when you want **dependency inversion with shared functionality**. + +Would you like a real-world ASP.NET Core example, like how DI containers work with abstract classes vs. interfaces? 🚀 + + +![[Pasted image 20250212184706.png]] \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/.vs/DILastSession/DesignTimeBuild/.dtbcache.v2 b/Sessions/DILastSession/DILastSession/.vs/DILastSession/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..f6a4b16 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/DILastSession/DesignTimeBuild/.dtbcache.v2 differ diff --git a/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/358bcc67-b3e5-4cd2-9984-3aecd4842c87.vsidx b/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/358bcc67-b3e5-4cd2-9984-3aecd4842c87.vsidx new file mode 100644 index 0000000..a54b869 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/358bcc67-b3e5-4cd2-9984-3aecd4842c87.vsidx differ diff --git a/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/99aeb7ce-2563-4631-b966-40de4255c41b.vsidx b/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/99aeb7ce-2563-4631-b966-40de4255c41b.vsidx new file mode 100644 index 0000000..70aef67 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/99aeb7ce-2563-4631-b966-40de4255c41b.vsidx differ diff --git a/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/d07aa008-5d90-4a0f-91a4-fd404b9f6842.vsidx b/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/d07aa008-5d90-4a0f-91a4-fd404b9f6842.vsidx new file mode 100644 index 0000000..70aef67 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/DILastSession/FileContentIndex/d07aa008-5d90-4a0f-91a4-fd404b9f6842.vsidx differ diff --git a/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/.futdcache.v2 b/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/.futdcache.v2 new file mode 100644 index 0000000..5fb247b Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/.futdcache.v2 differ diff --git a/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/.suo b/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/.suo new file mode 100644 index 0000000..149cbbb Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/.suo differ diff --git a/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/DocumentLayout.backup.json b/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/DocumentLayout.backup.json new file mode 100644 index 0000000..13c4255 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/DocumentLayout.backup.json @@ -0,0 +1,121 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\externalservice\\service01.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:externalservice\\service01.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\lifecycle\\a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:lifecycle\\a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\framework\\interface\\iservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:framework\\interface\\iservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\externalservice\\service02.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:externalservice\\service02.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 79, + "SelectedChildIndex": 2, + "Children": [ + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "IService.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Framework\\Interface\\IService.cs", + "RelativeDocumentMoniker": "Framework\\Interface\\IService.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Framework\\Interface\\IService.cs", + "RelativeToolTip": "Framework\\Interface\\IService.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAuwAsAAAASAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T18:55:09.39Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 4, + "Title": "Service02.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service02.cs", + "RelativeDocumentMoniker": "ExternalService\\Service02.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service02.cs", + "RelativeToolTip": "ExternalService\\Service02.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAuwBIAAAAYAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T18:52:36.106Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "Service01.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service01.cs", + "RelativeDocumentMoniker": "ExternalService\\Service01.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service01.cs", + "RelativeToolTip": "ExternalService\\Service01.cs", + "ViewState": "AgIAAAYAAAAAAAAAAAAuwBkAAAA4AAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T18:47:48.002Z", + "EditorCaption": "" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{eefa5220-e298-11d0-8f78-00a0c9110057}" + }, + { + "$type": "Bookmark", + "Name": "ST:1:0:{e8b06f52-6d01-11d2-aa7d-00c04f990343}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{b1e99781-ab81-11d0-b683-00aa00a3ee26}" + }, + { + "$type": "Bookmark", + "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "Program.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Program.cs", + "RelativeDocumentMoniker": "Program.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Program.cs", + "RelativeToolTip": "Program.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAA4AAAATAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T18:47:14.626Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "A.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\LifeCycle\\A.cs", + "RelativeDocumentMoniker": "LifeCycle\\A.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\LifeCycle\\A.cs", + "RelativeToolTip": "LifeCycle\\A.cs", + "ViewState": "AgIAAAQAAAAAAAAAAAAuwBQAAAAVAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T14:42:51.021Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/DocumentLayout.json b/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/DocumentLayout.json new file mode 100644 index 0000000..aa57656 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/.vs/DILastSession/v17/DocumentLayout.json @@ -0,0 +1,172 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\lifecycle\\a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:lifecycle\\a.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\lifecycle\\b.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:lifecycle\\b.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\externalservice\\service03.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:externalservice\\service03.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\framework\\base\\baseservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:framework\\base\\baseservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\framework\\interface\\iservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:framework\\interface\\iservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\externalservice\\service01.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:externalservice\\service01.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|e:\\theorder\\asp.net\\asp.net\\repo\\sessions\\dilastsession\\dilastsession\\externalservice\\service02.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}|DILastSession.csproj|solutionrelative:externalservice\\service02.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 79, + "SelectedChildIndex": 10, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{eefa5220-e298-11d0-8f78-00a0c9110057}" + }, + { + "$type": "Bookmark", + "Name": "ST:1:0:{e8b06f52-6d01-11d2-aa7d-00c04f990343}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{b1e99781-ab81-11d0-b683-00aa00a3ee26}" + }, + { + "$type": "Bookmark", + "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "B.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\LifeCycle\\B.cs", + "RelativeDocumentMoniker": "LifeCycle\\B.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\LifeCycle\\B.cs", + "RelativeToolTip": "LifeCycle\\B.cs", + "ViewState": "AgIAAAYAAAAAAAAAAAAAABIAAAASAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T19:11:24.914Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "Service03.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service03.cs", + "RelativeDocumentMoniker": "ExternalService\\Service03.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service03.cs", + "RelativeToolTip": "ExternalService\\Service03.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAkAAAAaAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T19:04:04.435Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 4, + "Title": "BaseService.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Framework\\Base\\BaseService.cs", + "RelativeDocumentMoniker": "Framework\\Base\\BaseService.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Framework\\Base\\BaseService.cs", + "RelativeToolTip": "Framework\\Base\\BaseService.cs", + "ViewState": "AgIAAAMAAAAAAAAAAAAAAAgAAAAxAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T19:03:53.657Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 5, + "Title": "IService.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Framework\\Interface\\IService.cs", + "RelativeDocumentMoniker": "Framework\\Interface\\IService.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Framework\\Interface\\IService.cs", + "RelativeToolTip": "Framework\\Interface\\IService.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAuwAwAAAASAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T18:55:09.39Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 7, + "Title": "Service02.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service02.cs", + "RelativeDocumentMoniker": "ExternalService\\Service02.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service02.cs", + "RelativeToolTip": "ExternalService\\Service02.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAuwBIAAAAYAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T18:52:36.106Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 6, + "Title": "Service01.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service01.cs", + "RelativeDocumentMoniker": "ExternalService\\Service01.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\ExternalService\\Service01.cs", + "RelativeToolTip": "ExternalService\\Service01.cs", + "ViewState": "AgIAAAEAAAAAAAAAAAAYwAkAAAATAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T18:47:48.002Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "Program.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Program.cs", + "RelativeDocumentMoniker": "Program.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\Program.cs", + "RelativeToolTip": "Program.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAA0AAAAxAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T18:47:14.626Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "A.cs", + "DocumentMoniker": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\LifeCycle\\A.cs", + "RelativeDocumentMoniker": "LifeCycle\\A.cs", + "ToolTip": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\LifeCycle\\A.cs", + "RelativeToolTip": "LifeCycle\\A.cs", + "ViewState": "AgIAAAQAAAAAAAAAAAAuwBEAAAAiAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-02-12T14:42:51.021Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.metadata.v9.bin b/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.metadata.v9.bin new file mode 100644 index 0000000..d8799a7 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.metadata.v9.bin differ diff --git a/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.projects.v9.bin b/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.projects.v9.bin new file mode 100644 index 0000000..193fe27 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.projects.v9.bin differ diff --git a/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.strings.v9.bin b/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.strings.v9.bin new file mode 100644 index 0000000..b1697db Binary files /dev/null and b/Sessions/DILastSession/DILastSession/.vs/ProjectEvaluation/dilastsession.strings.v9.bin differ diff --git a/Sessions/DILastSession/DILastSession/DILastSession.csproj b/Sessions/DILastSession/DILastSession/DILastSession.csproj new file mode 100644 index 0000000..2150e37 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/DILastSession.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/Sessions/DILastSession/DILastSession/DILastSession.sln b/Sessions/DILastSession/DILastSession/DILastSession.sln new file mode 100644 index 0000000..c10742e --- /dev/null +++ b/Sessions/DILastSession/DILastSession/DILastSession.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35431.28 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DILastSession", "DILastSession.csproj", "{CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB5CEF4E-1FED-4E80-9F2B-4AEDC4484AAC}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6352D060-2B76-41CB-96FC-0477043BC903} + EndGlobalSection +EndGlobal diff --git a/Sessions/DILastSession/DILastSession/ExternalService/Service01.cs b/Sessions/DILastSession/DILastSession/ExternalService/Service01.cs new file mode 100644 index 0000000..c57bff1 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/ExternalService/Service01.cs @@ -0,0 +1,30 @@ +using DILastSession.Framework.Interface; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DILastSession.ExternalService +{ + public class Service01 : IService + { + public Service01() + { + + } + public void M1() + { + Console.WriteLine("M1 is running in Server 1..."); + } + public void M2() + { + Console.WriteLine("M2 is running in Server 1..."); + } + public void M3() + { + Console.WriteLine("M3 is running in Server 1..."); + } + + } +} diff --git a/Sessions/DILastSession/DILastSession/ExternalService/Service02.cs b/Sessions/DILastSession/DILastSession/ExternalService/Service02.cs new file mode 100644 index 0000000..c00f2ad --- /dev/null +++ b/Sessions/DILastSession/DILastSession/ExternalService/Service02.cs @@ -0,0 +1,29 @@ +using DILastSession.Framework.Interface; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DILastSession.ExternalService +{ + public class Service02 : IService + { + public Service02() + { + } + public void M1() + { + Console.WriteLine("M1 is running in Service 2..."); + } + public void M2() + { + Console.WriteLine("M2 is running in Service 2..."); + } + public void M3() + { + Console.WriteLine("M3 is running in Service 2..."); + } + + } +} diff --git a/Sessions/DILastSession/DILastSession/ExternalService/Service03.cs b/Sessions/DILastSession/DILastSession/ExternalService/Service03.cs new file mode 100644 index 0000000..51474f4 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/ExternalService/Service03.cs @@ -0,0 +1,22 @@ +using DILastSession.Framework.Base; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DILastSession.ExternalService +{ + public class Service03 : BaseService + { + public Service03() + { + + } + + public override void M1() + { + //base.M1(); + } + } +} diff --git a/Sessions/DILastSession/DILastSession/Framework/Base/BaseService.cs b/Sessions/DILastSession/DILastSession/Framework/Base/BaseService.cs new file mode 100644 index 0000000..71cc8a4 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/Framework/Base/BaseService.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DILastSession.Framework.Base +{ + public class BaseService : Interface.IService + { + #region [ - Ctor - ] + public BaseService() + { + + } + #endregion + + #region [ - Methods - ] + + #region [ - M1() - ] + public virtual void M1() + { + throw new NotImplementedException(); + } + #endregion + + #region [ - M2() - ] + public virtual void M2() + { + throw new NotImplementedException(); + } + #endregion + + #region [ - M3() - ] + public virtual void M3() + { + throw new NotImplementedException(); + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/DILastSession/Framework/Interface/IService.cs b/Sessions/DILastSession/DILastSession/Framework/Interface/IService.cs new file mode 100644 index 0000000..6e6f0d1 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/Framework/Interface/IService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DILastSession.Framework.Interface +{ + public interface IService + { + #region [ - Methods - ] + void M1(); + void M2(); + void M3(); + #endregion + } +} diff --git a/Sessions/DILastSession/DILastSession/LifeCycle/A.cs b/Sessions/DILastSession/DILastSession/LifeCycle/A.cs new file mode 100644 index 0000000..47ed116 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/LifeCycle/A.cs @@ -0,0 +1,25 @@ +using DILastSession.ExternalService; +using DILastSession.Framework.Interface; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DILastSession.LifeCycle +{ + public class A + { + public A() + { + + } + + public void Print(IService newService) + { + IService service = newService; + service.M1(); + } + + } +} diff --git a/Sessions/DILastSession/DILastSession/LifeCycle/B.cs b/Sessions/DILastSession/DILastSession/LifeCycle/B.cs new file mode 100644 index 0000000..9df3ffa --- /dev/null +++ b/Sessions/DILastSession/DILastSession/LifeCycle/B.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DILastSession.LifeCycle +{ + public class B + { + #region [ - Ctor - ] + + #region [ - B(Framework.Interface.IService ref_IService) - ] + // Eager Aggregation + public B(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #region [ - A() - ] + public B() + { + + } + #endregion + + #endregion + + #region [ - Prop - ] + public Framework.Interface.IService Ref_IService { get; set; } + #endregion + + #region [ - Method - ] + + #region [ - InitializeIServiceRefrence(Framework.Interface.IService ref_IService) - ] + // Lazy Aggregation + public void InitializeIServiceRefrence(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/DILastSession/LifeCycle/C.cs b/Sessions/DILastSession/DILastSession/LifeCycle/C.cs new file mode 100644 index 0000000..73ea739 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/LifeCycle/C.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DILastSession.LifeCycle +{ + public class C + { + #region [ - Ctor - ] + + #region [ - C(Framework.Interface.IService ref_IService) - ] + // Eager Aggregation + public C(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #region [ - C() - ] + public C() + { + + } + #endregion + + #endregion + + #region [ - Prop - ] + public Framework.Interface.IService Ref_IService { get; set; } + #endregion + + #region [ - Method - ] + + #region [ - InitializeIServiceRefrence(Framework.Interface.IService ref_IService) - ] + // Lazy Aggregation + public void InitializeIServiceRefrence(Framework.Interface.IService ref_IService) + { + Ref_IService = ref_IService; + } + #endregion + + #endregion + } +} diff --git a/Sessions/DILastSession/DILastSession/Program.cs b/Sessions/DILastSession/DILastSession/Program.cs new file mode 100644 index 0000000..65b0d5f --- /dev/null +++ b/Sessions/DILastSession/DILastSession/Program.cs @@ -0,0 +1,33 @@ +namespace DILastSession +{ + +internal class Program +{ + private static void Main(string[] args) + { + + Console.WriteLine("| Eager Aggregation :"); + + Console.WriteLine("A:"); + LifeCycle.A a = new LifeCycle.A(); + + a.Print(new ExternalService.Service01()); + a.Print(new ExternalService.Service02()); + + + + + //LifeCycle.A Ref_A_1 = new LifeCycle.A(); + //Ref_A_1.Ref_IService.M1(); + + //LifeCycle.A Ref_A_2 = new LifeCycle.A(); + //Ref_A_2.Ref_IService.M2(); + + //LifeCycle.A Ref_A_3 = new LifeCycle.A(); + //Ref_A_3.Ref_IService.M3(); + + Console.WriteLine("--------------"); + + } + } +} \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.deps.json b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.deps.json new file mode 100644 index 0000000..96b4175 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "DILastSession/1.0.0": { + "runtime": { + "DILastSession.dll": {} + } + } + } + }, + "libraries": { + "DILastSession/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.dll b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.dll new file mode 100644 index 0000000..2232bf9 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.dll differ diff --git a/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.exe b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.exe new file mode 100644 index 0000000..5636c55 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.exe differ diff --git a/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.pdb b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.pdb new file mode 100644 index 0000000..5e1cb53 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.pdb differ diff --git a/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.runtimeconfig.json b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.runtimeconfig.json new file mode 100644 index 0000000..becfaea --- /dev/null +++ b/Sessions/DILastSession/DILastSession/bin/Debug/net8.0/DILastSession.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.dgspec.json b/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.dgspec.json new file mode 100644 index 0000000..77d6bb4 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\DILastSession.csproj": {} + }, + "projects": { + "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\DILastSession.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\DILastSession.csproj", + "projectName": "DILastSession", + "projectPath": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\DILastSession.csproj", + "packagesPath": "C:\\Users\\LENOVO\\.nuget\\packages\\", + "outputPath": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\LENOVO\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "C:\\Program Files\\dotnet\\library-packs": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.404/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.g.props b/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.g.props new file mode 100644 index 0000000..ed08317 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.g.props @@ -0,0 +1,16 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\LENOVO\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.11.1 + + + + + + \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.g.targets b/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/DILastSession.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs new file mode 100644 index 0000000..2217181 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.AssemblyInfo.cs b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.AssemblyInfo.cs new file mode 100644 index 0000000..5f52cce --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("DILastSession")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+37b5d21676bf6e89e3d95a8e749397ed5d7e5a88")] +[assembly: System.Reflection.AssemblyProductAttribute("DILastSession")] +[assembly: System.Reflection.AssemblyTitleAttribute("DILastSession")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.AssemblyInfoInputs.cache b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.AssemblyInfoInputs.cache new file mode 100644 index 0000000..0cc3266 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +654e054d71ab58745f73089ca3d79f59fbb69d11ec54e190d79d4669459b9c39 diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.GeneratedMSBuildEditorConfig.editorconfig b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..468c5ba --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,13 @@ +is_global = true +build_property.TargetFramework = net8.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = DILastSession +build_property.ProjectDir = E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.GlobalUsings.g.cs b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.assets.cache b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.assets.cache new file mode 100644 index 0000000..5629294 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.assets.cache differ diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.csproj.BuildWithSkipAnalyzers b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.csproj.BuildWithSkipAnalyzers new file mode 100644 index 0000000..e69de29 diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.csproj.CoreCompileInputs.cache b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..f068bd8 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +8e5fe731a8d6bf97edecb117fd8174f29b3c5b1dea86b1f50ee683382c356311 diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.csproj.FileListAbsolute.txt b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..662dd63 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.csproj.FileListAbsolute.txt @@ -0,0 +1,30 @@ +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\bin\Debug\net8.0\DILastSession.exe +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\bin\Debug\net8.0\DILastSession.deps.json +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\bin\Debug\net8.0\DILastSession.runtimeconfig.json +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\bin\Debug\net8.0\DILastSession.dll +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\bin\Debug\net8.0\DILastSession.pdb +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\DILastSession.GeneratedMSBuildEditorConfig.editorconfig +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\DILastSession.AssemblyInfoInputs.cache +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\DILastSession.AssemblyInfo.cs +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\DILastSession.csproj.CoreCompileInputs.cache +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\DILastSession.sourcelink.json +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\DILastSession.dll +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\refint\DILastSession.dll +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\DILastSession.pdb +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\DILastSession.genruntimeconfig.cache +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\LastSession\DILastSession\obj\Debug\net8.0\ref\DILastSession.dll +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\bin\Debug\net8.0\DILastSession.exe +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\bin\Debug\net8.0\DILastSession.deps.json +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\bin\Debug\net8.0\DILastSession.runtimeconfig.json +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\bin\Debug\net8.0\DILastSession.dll +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\bin\Debug\net8.0\DILastSession.pdb +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\DILastSession.GeneratedMSBuildEditorConfig.editorconfig +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\DILastSession.AssemblyInfoInputs.cache +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\DILastSession.AssemblyInfo.cs +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\DILastSession.csproj.CoreCompileInputs.cache +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\DILastSession.sourcelink.json +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\DILastSession.dll +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\refint\DILastSession.dll +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\DILastSession.pdb +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\DILastSession.genruntimeconfig.cache +E:\TheOrder\ASP.NET\ASP.NET\Repo\Sessions\DILastSession\DILastSession\obj\Debug\net8.0\ref\DILastSession.dll diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.dll b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.dll new file mode 100644 index 0000000..2232bf9 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.dll differ diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.genruntimeconfig.cache b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.genruntimeconfig.cache new file mode 100644 index 0000000..3ec6ba7 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.genruntimeconfig.cache @@ -0,0 +1 @@ +d125f90019339cdc3998da8d2edfe0d84f8352d20f174498fc95f6431054a406 diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.pdb b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.pdb new file mode 100644 index 0000000..5e1cb53 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.pdb differ diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.sourcelink.json b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.sourcelink.json new file mode 100644 index 0000000..5daf027 --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/DILastSession.sourcelink.json @@ -0,0 +1 @@ +{"documents":{"E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\*":"https://raw.githubusercontent.com/TheOrderOfPhoenix/ASP.NET/37b5d21676bf6e89e3d95a8e749397ed5d7e5a88/*"}} \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/apphost.exe b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/apphost.exe new file mode 100644 index 0000000..5636c55 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/apphost.exe differ diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/ref/DILastSession.dll b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/ref/DILastSession.dll new file mode 100644 index 0000000..18bcb78 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/ref/DILastSession.dll differ diff --git a/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/refint/DILastSession.dll b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/refint/DILastSession.dll new file mode 100644 index 0000000..18bcb78 Binary files /dev/null and b/Sessions/DILastSession/DILastSession/obj/Debug/net8.0/refint/DILastSession.dll differ diff --git a/Sessions/DILastSession/DILastSession/obj/project.assets.json b/Sessions/DILastSession/DILastSession/obj/project.assets.json new file mode 100644 index 0000000..8733ddb --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/project.assets.json @@ -0,0 +1,79 @@ +{ + "version": 3, + "targets": { + "net8.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net8.0": [] + }, + "packageFolders": { + "C:\\Users\\LENOVO\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\DILastSession.csproj", + "projectName": "DILastSession", + "projectPath": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\DILastSession.csproj", + "packagesPath": "C:\\Users\\LENOVO\\.nuget\\packages\\", + "outputPath": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\LENOVO\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "C:\\Program Files\\dotnet\\library-packs": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.404/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Sessions/DILastSession/DILastSession/obj/project.nuget.cache b/Sessions/DILastSession/DILastSession/obj/project.nuget.cache new file mode 100644 index 0000000..a5a3b8f --- /dev/null +++ b/Sessions/DILastSession/DILastSession/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "XRB5scheZK8=", + "success": true, + "projectFilePath": "E:\\TheOrder\\ASP.NET\\ASP.NET\\Repo\\Sessions\\DILastSession\\DILastSession\\DILastSession.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file diff --git a/Sessions/DILastSession/Session Notes.txt b/Sessions/DILastSession/Session Notes.txt new file mode 100644 index 0000000..8706d6c --- /dev/null +++ b/Sessions/DILastSession/Session Notes.txt @@ -0,0 +1,34 @@ +A really quick overview + 1. A class that initializes a service + 2. A class that simply uses a service + 3. A class that uses more than one similar services + 4. A class that uses an interface as a service + 5. Two classes that use that interface as a service + 6. An abstract class... + +Ali Explaining the last part of the DI Project + +Databases + +Microsoft SQL Server + +Entity Framework Core + +ORM - Object Relational Mapper + +Code First vs Database First + +DbContext -> used as: ++ A bridge between your C# code and the database. ++ A session that manages all operations for a specific unit of work. ++ A container that holds your entity sets (tables). + +We Need a DbContext in some controllers + +Where does the initialization happen? + +Next Steps + +Future Plans... + + diff --git a/Sessions/Project Notes.md b/Sessions/Project Notes.md new file mode 100644 index 0000000..f8b5cd3 --- /dev/null +++ b/Sessions/Project Notes.md @@ -0,0 +1,92 @@ +# Name: alibaba.ir + +## Stack +> .NET 8 (LTS) - Domain Driven Design (DDD) +> Database: MS SQL Server - Code First - EF Core +> Front: React with TS + +## Entities + +### Person +id +firstname +lastname +... +### Role +Id +Title (User, Admin, Emp) +### Account +PersonId +RoleId +password + +### Company +id +title + +### Transportation +id +srcId +destId +startTime +endTime +capacity +remainingPlaces +vehicleId +price +companyId + +### City +id +title + +### Base +id +location +type +cityId + +### Vehicle +id +typeId + +### Company +### Type + +### Ticket +tranportationId +seatId +buyerId +travellerId +cancelled + +### Seat +vehicleId +row +column +vipFlag + +### Transaction +buyerId +amount? +ticketId +couponId +serialNo + + +Not Mapped +### Search +### +### + + +## Phases + + + +## Questions +### Authentication and Authorization +### Roles in database, how to handle multiple roles +### DB Management of person sub classes +### Should we complete the whole db +### How to handle tickets diff --git a/Sessions/Session05/05_Notes.md b/Sessions/Session05/05_Notes.md index 94d72b1..079d5d3 100644 --- a/Sessions/Session05/05_Notes.md +++ b/Sessions/Session05/05_Notes.md @@ -65,7 +65,7 @@ interface IDisplayer } // A class that implements interface. -class testClass : IDisplayer +class testClass : IDisplayer , { // providing the body part of function @@ -344,18 +344,27 @@ namespace Entity2 public Car() { } public string Color { get; set; } public string Max_Speed { get; set; } + public Engine Engine {get; set;} } class Suzuki : Car { - public Suzuki() { } + public Suzuki() + { + Engine = new Engine(); // Eager Composition + } + + public Suzuki(Engine engine) // Eager Aggregation + { + Engine = engine; + } + public int Total_Seats { get; set; } public string Model_No { get; set; } public void CarInfo() { string Info = $"Color of car is {this.Color} \nMaximum speed is {this.Max_Speed}\nNumber of seats is {this.Total_Seats}\nModel No is {this.Model_No}\n"; WriteLine(Info); - Engine Obj = new Engine(); - Obj.Engine_Info(); + Engine.Engine_Info(); } } class Engine @@ -626,7 +635,7 @@ namespace LibraryManagementSystem // Create Bookshelf and Books Bookshelf shelf1 = new Bookshelf { ShelfNumber = 1 }; shelf1.AddBook(new Book { Title = "C# Programming", Author = "John Doe" }); - shelf1.AddBook(new Book { Title = "Data Structures", Author = "Jane Smith" }); + shelf1.AddBook(new Book { Title = "Data Structures", Author = "Jane Smith"}); // Add Bookshelf to Library (Composition) library.AddBookshelf(shelf1); diff --git a/Sessions/Session05/Projects/Library/.vs/MyLibrary/DesignTimeBuild/.dtbcache.v2 b/Sessions/Session05/Projects/Library/.vs/MyLibrary/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..9086a8e Binary files /dev/null and b/Sessions/Session05/Projects/Library/.vs/MyLibrary/DesignTimeBuild/.dtbcache.v2 differ diff --git a/Sessions/Session05/Projects/Library/.vs/MyLibrary/FileContentIndex/477a85fb-37bf-424c-9a31-f9d785606db2.vsidx b/Sessions/Session05/Projects/Library/.vs/MyLibrary/FileContentIndex/477a85fb-37bf-424c-9a31-f9d785606db2.vsidx new file mode 100644 index 0000000..1a2bf1e Binary files /dev/null and b/Sessions/Session05/Projects/Library/.vs/MyLibrary/FileContentIndex/477a85fb-37bf-424c-9a31-f9d785606db2.vsidx differ diff --git a/Sessions/Session05/Projects/Library/.vs/MyLibrary/v17/.futdcache.v2 b/Sessions/Session05/Projects/Library/.vs/MyLibrary/v17/.futdcache.v2 new file mode 100644 index 0000000..26dd5ee Binary files /dev/null and b/Sessions/Session05/Projects/Library/.vs/MyLibrary/v17/.futdcache.v2 differ diff --git a/Sessions/Session05/Projects/Library/.vs/MyLibrary/v17/.suo b/Sessions/Session05/Projects/Library/.vs/MyLibrary/v17/.suo index a11ad0e..1c25512 100644 Binary files a/Sessions/Session05/Projects/Library/.vs/MyLibrary/v17/.suo and b/Sessions/Session05/Projects/Library/.vs/MyLibrary/v17/.suo differ diff --git a/Sessions/Session05/Projects/Library/.vs/ProjectEvaluation/mylibrary.metadata.v7.bin b/Sessions/Session05/Projects/Library/.vs/ProjectEvaluation/mylibrary.metadata.v7.bin new file mode 100644 index 0000000..41d90da Binary files /dev/null and b/Sessions/Session05/Projects/Library/.vs/ProjectEvaluation/mylibrary.metadata.v7.bin differ diff --git a/Sessions/Session05/Projects/Library/.vs/ProjectEvaluation/mylibrary.projects.v7.bin b/Sessions/Session05/Projects/Library/.vs/ProjectEvaluation/mylibrary.projects.v7.bin new file mode 100644 index 0000000..12251fa Binary files /dev/null and b/Sessions/Session05/Projects/Library/.vs/ProjectEvaluation/mylibrary.projects.v7.bin differ