Skip to content

Instantly share code, notes, and snippets.

@amr-swalha
amr-swalha / CreateABucket.cs
Created December 7, 2018 17:44
The code to create a bucket
static void CreateABucket()
{
try
{
PutBucketRequest request = new PutBucketRequest();
request.BucketName = bucketName;
client.PutBucket(request);
}
catch (AmazonS3Exception amazonS3Exception)
{
@amr-swalha
amr-swalha / Script.sql
Created May 20, 2018 06:27
Script for Database for ASP.NET Core Course
/****** Object: Table [dbo].[Customer] Script Date: 5/20/2018 10:26:06 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Customer](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) NULL,
[Email] [nvarchar](200) NULL,
[Phone] [nvarchar](200) NULL,
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="PrismApp.Views.MainPage"
Title="{Binding Title}">
<StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
<Label Text="Welcome to Xamarin Forms and Prism!" />
<Button Text="Go to Second Page" Command="{Binding NavigateToSecond}"></Button>
</StackLayout>
public void NavigateToSecondCall()
{
_navigationService.NavigateAsync("SecondPage");
}
public MainPageViewModel(INavigationService navigationService)
: base (navigationService)
{
Title = "Main Page";
_navigationService = navigationService;
NavigateToSecond = new DelegateCommand(NavigateToSecondCall);
}
public DelegateCommand NavigateToSecond { get; set; } //It will hold the nivgation
private INavigationService _navigationService; //To get the navigationservice
{
"Name":"Amr",
"Email":"test@tutorialsxl.com"
}
@amr-swalha
amr-swalha / FunctionTest.cs
Created March 17, 2018 12:56
Updating Function Test
public class FunctionTest
{
[Fact]
public void TestToUpperFunction()
{
// Invoke the lambda function and confirm the string was upper cased.
var function = new Function();
var context = new TestLambdaContext();
Student student = new Student
@amr-swalha
amr-swalha / Function.cs
Created March 17, 2018 12:52
FunctionHandler Student Parameter
public string FunctionHandler(Student input, ILambdaContext context)
{
return $"Name: {input.Name}, Email: {input.Email}";
}
@amr-swalha
amr-swalha / Student.cs
Created March 17, 2018 12:50
POCO Student
namespace LambdaService
{
public class Student
{
public string Name { get; set; }
public string Email { get; set; }
}
}