示例#1
0
        public EventsController(MoonshineCafeContext context)
        {
            _context = context;

            using (var stream =
                       new FileStream(jsonFile, FileMode.Open, FileAccess.Read))
            {
                // The file token.json stores the user's access and refresh tokens, and is created
                // automatically when the authorization flow completes for the first time.
                var confg = Google.Apis.Json.NewtonsoftJsonSerializer.Instance.Deserialize <JsonCredentialParameters>(stream);
                credential = new ServiceAccountCredential(
                    new ServiceAccountCredential.Initializer(confg.ClientEmail)
                {
                    Scopes = Scopes
                }.FromPrivateKey(confg.PrivateKey));
                SetService(credential);
            }
        }
 public ReservationsController(MoonshineCafeContext context)
 {
     _context = context;
 }
 public BandsController(MoonshineCafeContext context)
 {
     _context = context;
 }
 public AdminHomeController(MoonshineCafeContext context)
 {
     _context = context;
 }
 public CustomersController(MoonshineCafeContext context)
 {
     _context = context;
 }