Database entities (models) required for Cosmos database

Author: SAREKA AVINASH

Originally Sourced from: https://stackoverflow.com/questions/60414730/database-entities-models-required-for-cosmos-database

Question1:
Earlier, we are using WebApi+SqlServer and now we want to migrate to WebApi+Cosmos DB.

Earlier Implementation(WebApi+SqlServer): 1. We have created one Employee model which will be a map to an object that comes from UI(postman here)
2. Later we will perform validations on that model in WebApi.
3. Next, that model will be map to DatabaseEmployee(SQL server) entity and insert into the SQL server.

New Implementation(WebApi+CosmosDB -SQL API+DocumentDB): 1. Step1 and Step2 of above will be done here as well
2. Do we need to create a DatabaseEmployee entity here as well or else we can directly insert data into CosmosDB without mapping the Employee model to DatabaseEmployee model?

Note: I think:
a) One-One mapping: no need to create a CosmosDB entity(DatabaseEmployee).
b) One-Many mapping: we should create a CosmosDB entity(DatabaseEmployee).
c) Many-Many mapping: we should create a CosmosDB entity(DatabaseEmployee).

Question2:
For One-Many mapping consider the following example 2 tables Employee and Department:
Employee: EmpID, Name, Address
Department: DeptID, DeptName,EmpId
In SQL Server we have foreign key constraints so we can maintain 2 tables.
In Cosmos DB, do we need to create 2 different containers or else 1 container is sufficient as below?

{
DeptId:101,
DeptName: "XXX",
EmpData:
  {
     EmpId: 101,
     Empname:"AAA"
  },
 {
     EmpId: 102,
     Empname:"BBB"
 }
}

If one container is sufficient then my UI model must be as below:

Public class Department
{
  public int DeptId {get;set;}
  public string Deptname {get;set;}
  public List<Employee> EmpData {get;set;}
}

But we have models like :

public class Employee
{
 public int EmpId {get;set;}
 public string EmpName {get;set;}
}

public class Department
{ 
 public int DeptId {get;set;}
 public string DeptName {get;set;}
 public int EMpId {get;set;}  ** ForeignKey constraint as per SQL server **
}

Note:
How to maintain the model in WebApi and how to create database entities that resemble CosmosDB container?