-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
52 lines (42 loc) · 1.45 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using Microsoft.Extensions.DependencyInjection;
using System.Linq;
using DiConsoleApp.Models;
using System.Collections.Generic;
using DiConsoleApp.Services;
namespace DiConsoleApp
{
class Program
{
static void Main(string[] args)
{
/*dependency injection*/
var startup = new Startup();
///some service
var service = startup.Provider.GetRequiredService<ISomeService>();
service.DoProcess();
//connection service
var connectionService = startup.Provider.GetRequiredService<IConnectionService>();
string conStr = connectionService.GetConnectionString();
Console.WriteLine("connection string" + conStr);
/*dependency injection*/
/*linq*/
ProductService.readProduct();
//INSERT
// if (ProductService.InsertProduct("INK Pen")==true)
// {
// Console.WriteLine("INK PEN INSERTED");
// }
//UPDATE
// if (ProductService.updateProduct(3,"THE INK Pen")==true)
// {
// Console.WriteLine("INK PEN Updated");
// }
//DELETE
// if(ProductService.deleteProduct(3)==true)
// {
// Console.WriteLine("INK Pen Deleted");
// }
}
}
}