This file contains 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.AspNetCore; | |
using Microsoft.AspNetCore.Hosting; | |
namespace Theta.Customers.API | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ |
This file contains 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 MongoDB.Driver; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Theta.Customers.Models; | |
namespace Theta.Customers.Repository | |
{ | |
public class CustomerRepos | |
{ |
This file contains 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
namespace Theta.Customers.Models | |
{ | |
public class Address | |
{ | |
public string Country; | |
public string State; | |
public string Area; | |
public string Street; | |
public int HouseNum; | |
} |
This file contains 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
namespace Theta.Customers.Models | |
{ | |
public class Customer | |
{ | |
public int _id; | |
public string FirstName; | |
public string LastName; | |
//public bool IsPremium; | |
public Address Address; | |
} |
This file contains 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
namespace Theta.Customers.Models | |
{ | |
public class Customer | |
{ | |
public int _id; | |
public string FirstName; | |
public string LastName; | |
//public bool IsPremium; | |
public Address Address; | |
} |
This file contains 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
namespace Theta.Customers.Models | |
{ | |
public class Customer | |
{ | |
public int _id; | |
public string FirstName; | |
public string LastName; | |
//public bool IsPremium; | |
public Address Address; | |
} |
This file contains 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
namespace Theta.Customers.Models | |
{ | |
public class Customer | |
{ | |
public int _id; | |
public string FirstName; | |
public string LastName; | |
//public bool IsPremium; | |
public Address Address; | |
} |
This file contains 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
private Node CreateNode(Person person) | |
{ | |
Node node = new Node(); | |
node.person = person; | |
node.Next = null; | |
return node; | |
} |
This file contains 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
public void Add(Person person) | |
{ | |
Node node = CreateNode(person); | |
if (Head == null) | |
{ | |
Head = node; | |
return; | |
} | |
if(Head.Next == null) | |
{ |
This file contains 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
Node Head; | |
public LinkedList() | |
{ | |
Head = null; | |
} |