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
PermuteAString
transform string to hex code
Problem_rstring
Merging and sorting 2 arrays using LINQ
sdfghjikujyhtgrfedwcdf
ruSrib
a1
Kz
1.1 Basics: language constructs
4