Skip to content

Instantly share code, notes, and snippets.

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

Sumit Kharche sumitkharche

👩‍💻
Coding
View GitHub Profile
import React from 'react';
import { Stack, Label } from '@fluentui/react';
function TodoItem(props: any) {
return (
<Stack>
<Stack horizontal verticalAlign="center" horizontalAlign="space-between">
<Label>{props.todo.name}</Label>
</Stack>
</Stack>
import React from 'react';
import { Stack, Label } from "@fluentui/react";
import TodoItem from './TodoItem';
function TodoList(props:any) {
return (
<Stack gap={10} >
{ props.todos.length > 0 ? props.todos.map((todo: any) => (
<TodoItem todo={todo} key={todo.id}/>
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { Fabric } from "@fluentui/react";
ReactDOM.render(
<React.StrictMode>
<Fabric>
@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}>
@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 / 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 / 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 / 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 / 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 / AutoMapperProfile.cs
Created January 6, 2020 19:05
AutoMapperProfile class
using AutoMapper;
namespace automapper_sample
{
public class AutoMapperProfile : Profile
{
public AutoMapperProfile()
{
CreateMap<StudentDTO, Student>();
}