Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
mine
using Microsoft.EntityFrameworkCore; using System; using System.Linq; using static System.Console; namespace EF_DataAcess { class Program { private static readonly LoginCred ob2; private static AppContext builder = new AppContext(); static void Main(string[] args) { Console.WriteLine("Program Execution Starts........."); int id,optn = 1; string passwrd = ""; while (optn != -1) { if (optn == 1) Display(); if (optn == 2) { id = Convert.ToInt32(ReadLine()); passwrd = ReadLine(); insert(id, passwrd); } if (optn == 3) { id = Convert.ToInt32(ReadLine()); remove(id); } WriteLine("Enter your choice"); optn = Convert.ToInt32(ReadLine()); } Console.WriteLine("Operation Ends......................."); } static void insert(int id,string password) { WriteLine("Insert operation executed"); var ob = new LoginCred(); ob.Id = id; ob.Password = password; builder.LoginCreds.Add(ob); builder.SaveChanges(); } static void remove(int id) { WriteLine("Remove operation executed"); var ob = new LoginCred() { Id = id }; builder.LoginCreds.Remove(ob); builder.SaveChanges(); } static void Display() { WriteLine("Displaying data:"); var res = builder.LoginCreds; foreach(var ob in res) { WriteLine(ob.Id); } } } }
run
|
edit
|
history
|
help
0
Fórum Parallel Threads ( With Much Fun )
The health benefits of gynostemma pentaphyllum
Server last restarted
ejemplo c# 2
badsql_match
izem
string + null
Chest Interaction Unity
RRE
sdfrgthyjuiloiujyhtgrf