Table of Contents

Class Company

Namespace
GastroSky.Models
Assembly
GastroSky.Models.dll

Companies table.

[Table("Companies")]
[Index("Slug", new string[] { }, IsUnique = true)]
[Index("Email", new string[] { }, IsUnique = true)]
public class Company
Inheritance
Company
Inherited Members

Properties

Address

Company address.

public required string Address { get; set; }

Property Value

string

BusinessIdentificationNumber

E.g. CHE-000.000.000

public string? BusinessIdentificationNumber { get; set; }

Property Value

string

CompanySubscriptions

public ICollection<CompanySubscription> CompanySubscriptions { get; set; }

Property Value

ICollection<CompanySubscription>

CountryCodeISO

3-letter ISO code of where the company is located.

[MaxLength(3)]
public string? CountryCodeISO { get; set; }

Property Value

string

CreationTimestampUTC

Unix-timestamp of when this Company was inserted into the DB.

public required long CreationTimestampUTC { get; set; }

Property Value

long

DeactivatedOnTimestampUTC

public long? DeactivatedOnTimestampUTC { get; set; }

Property Value

long?

Email

Company email address.

public required string Email { get; set; }

Property Value

string

Id

Sequential integer primary key.

[Key]
public long Id { get; set; }

Property Value

long

Location

[ForeignKey("LocationId")]
public Location? Location { get; set; }

Property Value

Location

LocationId

public long? LocationId { get; set; }

Property Value

long?

Members

public ICollection<UserCompany> Members { get; set; }

Property Value

ICollection<UserCompany>

Name

Company name (including legal form suffix).

public required string Name { get; set; }

Property Value

string

Phone

Company phone number.

public required string Phone { get; set; }

Property Value

string

Posts

public ICollection<Post> Posts { get; set; }

Property Value

ICollection<Post>

ProfilePictureBytes

Profile picture, Base64-encoded.

[NotMapped]
public byte[]? ProfilePictureBytes { get; set; }

Property Value

byte[]

ProfilePictureFileGuid

Remote file access token of the company's profile picture.

public Guid? ProfilePictureFileGuid { get; set; }

Property Value

Guid?

Slug

Company slug.

[MaxLength(8)]
public required string Slug { get; set; }

Property Value

string

Users

public ICollection<User> Users { get; set; }

Property Value

ICollection<User>

WebsiteURL

The company's website URL.

public string? WebsiteURL { get; set; }

Property Value

string

Methods

GetActiveMembers()

public IEnumerable<UserCompany> GetActiveMembers()

Returns

IEnumerable<UserCompany>

GetAdmins()

public IEnumerable<UserCompany> GetAdmins()

Returns

IEnumerable<UserCompany>

GetInvitedMembers()

public IEnumerable<UserCompany> GetInvitedMembers()

Returns

IEnumerable<UserCompany>

GetPastMembers()

public IEnumerable<UserCompany> GetPastMembers()

Returns

IEnumerable<UserCompany>

HasJoinedMember(User)

public bool HasJoinedMember(User user)

Parameters

user User

Returns

bool

MemberHasRole(User, CompanyRole)

public bool MemberHasRole(User user, CompanyRole role)

Parameters

user User
role CompanyRole

Returns

bool