Skip to content

Instantly share code, notes, and snippets.

View sumitkharche's full-sized avatar
👩‍💻
Coding

Sumit Kharche sumitkharche

👩‍💻
Coding
View GitHub Profile
@sumitkharche
sumitkharche / App.svelte
Last active July 5, 2019 17:48
App.svelte
<script>
import { onMount } from "svelte";
import axios from "axios";
import config from "./config.js";
import TodoItem from "./TodoItem.svelte";
export let name;
let todo = "";
$: todos = [];
onMount(getTodos());
function getTodos() {
@sumitkharche
sumitkharche / Student.cs
Created January 6, 2020 18:21
Student class
namespace automapper_sample
{
public class Student
{
public string Name { get; set; }
public int Age { get; set; }
public string City { get; set; }
}
}
@sumitkharche
sumitkharche / StudentDTO.cs
Created January 6, 2020 18:23
StudentDTO class
namespace automapper_sample
{
public class StudentDTO
{
public string Name { get; set; }
public int Age { get; set; }
public string City { get; set; }
}
}
@sumitkharche
sumitkharche / AutoMapperProfile.cs
Created January 6, 2020 19:05
AutoMapperProfile class
using AutoMapper;
namespace automapper_sample
{
public class AutoMapperProfile : Profile
{
public AutoMapperProfile()
{
CreateMap<StudentDTO, Student>();
}
@sumitkharche
sumitkharche / StudentController.cs
Created January 6, 2020 19:20
StudentController
using AutoMapper;
using Microsoft.AspNetCore.Mvc;
namespace automapper_sample.Controllers
{
[Route("api/[controller]")]
public class StudentController : Controller
{
private readonly IMapper _mapper;
@sumitkharche
sumitkharche / Automapper.cs
Created January 10, 2020 16:59
Automapper.cs with projection
namespace automapper_sample
{
public class AutoMapperProfile : Profile
{
public AutoMapperProfile()
{
CreateMap<StudentDTO, Student>()
.ForMember(dest => dest.City, opt => opt.MapFrom(src => src.CurrentCity));
}
}
@sumitkharche
sumitkharche / AddressDTO.cs
Created January 10, 2020 17:44
AddressDTO.cs class
namespace automapper_sample
{
public class AddressDTO
{
public string State { get; set; }
public string Country { get; set; }
}
}
@sumitkharche
sumitkharche / AutoMapperProfile.cs
Created January 10, 2020 17:54
AutoMapperProfile.cs for nested class
using AutoMapper;
namespace automapper_sample
{
public class AutoMapperProfile : Profile
{
public AutoMapperProfile()
{
CreateMap<StudentDTO, Student>()
.ForMember(dest => dest.City, opt => opt.MapFrom(src => src.CurrentCity));
@sumitkharche
sumitkharche / AutoMapperProfile.cs
Created January 10, 2020 18:08
AutoMapperProfile.cs with conditional mappings
using AutoMapper;
namespace automapper_sample
{
public class AutoMapperProfile : Profile
{
public AutoMapperProfile()
{
CreateMap<StudentDTO, Student>()
.ForMember(dest => dest.City, opt => opt.MapFrom(src => src.CurrentCity))
@sumitkharche
sumitkharche / App.tsx
Created May 9, 2020 11:56
Stack layout structure
import React from 'react';
import './App.css';
import { Stack } from "@fluentui/react";
function App() {
return (
<div className="wrapper">
<Stack horizontalAlign="center">
<h1>Todo App using Fluent UI & React</h1>
<Stack style={{ width: 300 }} gap={25}>