コード例 #1
0
ファイル: DogService.cs プロジェクト: leinadpb/krustan
        public DogService(IConfiguration cfg, KrustanDbContext ctx)
        {
            this._context = ctx;
            Configuration = cfg;

            var credentials = new BasicAWSCredentials(Configuration["s3:AccessKey"].Trim(), Configuration["s3:SecretAccessKey"].Trim());

            client = new AmazonS3Client(credentials, Amazon.RegionEndpoint.USEast1);

            if (dogs.Count == 0)
            {
                dogs.Add(new Dog
                {
                    Name        = "Cosmo",
                    Weight      = 1.2f,
                    Height      = 3.2f,
                    Description = "Jugueton, amigable",
                    Age         = 2,
                    DogPicture  = @"https://images.dog.ceo/breeds/deerhound-scottish/n02092002_1339.jpg",
                    Sex         = "male",
                    OwnerId     = "123456789"
                });
                dogs.Add(new Dog
                {
                    Name        = "Locria",
                    Weight      = 4,
                    Height      = 6,
                    Description = "fuerte, amigable",
                    Age         = 3,
                    DogPicture  = @"https://images.dog.ceo/breeds/appenzeller/n02107908_3190.jpg",
                    Sex         = "male",
                    OwnerId     = "123456789"
                });
                dogs.Add(new Dog
                {
                    Name        = "Karma",
                    Weight      = 4.1f,
                    Height      = 12.5f,
                    Description = "juguetona, amigable, fuerte, coqueta...",
                    Age         = 4,
                    DogPicture  = @"https://images.dog.ceo/breeds/samoyed/n02111889_5463.jpg",
                    Sex         = "female",
                    OwnerId     = "123456789"
                });
            }
        }
コード例 #2
0
ファイル: UserService.cs プロジェクト: leinadpb/krustan
 public UserService(KrustanDbContext ctx)
 {
     this._context = ctx;
 }