I did these Linq Exercises in .NetFiddle and thought to have them here for easy access.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require('http') | |
| const fs = require('fs') | |
| const port = 3000 | |
| const server = http.createServer(function(req, res) { | |
| //res.write('Hello World') | |
| res.writeHead(200, { 'Content-Type': 'text/html' }) | |
| fs.readFile('index.html', function(error, data) { | |
| if (error) { |
USE [SalesDB]
GO
/****** Object: Table [dbo].[Orders] Script Date: 15/03/2026 11:24:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
Program.cs including:
- EF Core DbContext
- Seed data
- CORS setup for your React dev server
- Minimal API endpoints (CRUD for Customers)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.EntityFrameworkCore; | |
| using MiniFullStackApi.Models; | |
| var builder = WebApplication.CreateBuilder(args); | |
| // Add services to the container. | |
| builder.Services.AddControllers(); | |
| // Learn more abo ut configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle |
Perfect! Now that your database is ready with Customers and Orders, we can move to the backend setup. Since this is a mini full-stack practice project, I recommend using ASP.NET Core Web API instead of a console app. This will mimic a real interview scenario more closely:
- Open Visual Studio (or VSCode with C# extension + .NET SDK installed).
- New Project → ASP.NET Core Web API
- Project name:
MiniFullStackApi - .NET version: latest LTS (for now, 7.0 or 8.0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Data.SqlClient; | |
| class Program | |
| { | |
| private static string connectionString = "Server=(localdb)\\mssqllocaldb;Database=LinqPracticeDB;Trusted_Connection=True;"; | |
| static void Main() | |
| { | |
| Console.WriteLine("Current Tasks:"); | |
| ShowTasks(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {addDays, format, isAfter, isBefore, startOfDay} from 'date-fns'; | |
| import React, {Component, Fragment} from 'react'; | |
| import classes from 'classnames'; | |
| import DatePickerDialog from './DatePickerDialog'; | |
| import Dialog from 'components/Dialog'; | |
| import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; | |
| import {getDisabled} from '../../../utils/component'; | |
| import PropTypes from 'prop-types'; | |
| import './index.css'; |
NewerOlder