Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Imp
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 = 0; string passwrd = ""; while (optn != -1) { if (optn == 0) { Display(); } else if (optn == 1) { WriteLine("Insert operation executed"); Write("Enter Password: "); passwrd = ReadLine(); insert(passwrd); } else if (optn == 2) { WriteLine("Remove operation executed"); Write("Enter key of object to be deleted: "); id = Convert.ToInt32(ReadLine()); remove(id); } else { } WriteLine("Enter your choice"); optn = Convert.ToInt32(ReadLine()); } Console.WriteLine("Operation Ends......................."); } static void insert(string password) { var ob = new LoginCred(); ob.Password = password; builder.LoginCreds.Add(ob); builder.SaveChanges(); } static void remove(int id) { var ob = builder.LoginCreds.Find(id); WriteLine(ob); builder.LoginCreds.Remove(ob); builder.SaveChanges(); } static void Display() { var res = builder.LoginCreds; foreach (var ob in res) { WriteLine(ob); } } } }
run
|
edit
|
history
|
help
0
AX 2012 Test #1
buble sort
uniqueness
v3
Array Foreach with sum
Trials
asxsdf
sayalitrialc#
30272 Program Ex5_1 if else_2
golestanali