├── README.md
├── XamWebApiClient
├── XamWebApiClient
│ ├── AssemblyInfo.cs
│ ├── Services
│ │ ├── IBookService.cs
│ │ ├── InMemoryBookService.cs
│ │ └── ApiBookService.cs
│ ├── Views
│ │ ├── BookDetails.xaml.cs
│ │ ├── AddBook.xaml.cs
│ │ ├── Books.xaml.cs
│ │ ├── AddBook.xaml
│ │ ├── BookDetails.xaml
│ │ └── Books.xaml
│ ├── AppShell.xaml.cs
│ ├── Models
│ │ └── Book.cs
│ ├── App.xaml.cs
│ ├── Startup.cs
│ ├── XamWebApiClient.csproj
│ ├── ViewModels
│ │ ├── BaseViewModel.cs
│ │ ├── AddBookViewModel.cs
│ │ ├── BooksViewModel.cs
│ │ └── BookDetailsViewModel.cs
│ ├── GettingStarted.txt
│ ├── App.xaml
│ └── AppShell.xaml
└── XamWebApiClient.Android
│ ├── Resources
│ ├── mipmap-hdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-mdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── drawable
│ │ ├── icon_feed.png
│ │ ├── icon_about.png
│ │ └── xamarin_logo.png
│ ├── mipmap-xhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xxxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-anydpi-v26
│ │ ├── icon.xml
│ │ └── icon_round.xml
│ ├── values
│ │ ├── colors.xml
│ │ └── styles.xml
│ ├── layout
│ │ ├── Toolbar.xml
│ │ └── Tabbar.xml
│ └── AboutResources.txt
│ ├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
│ ├── Assets
│ └── AboutAssets.txt
│ ├── MainActivity.cs
│ └── XamWebApiClient.Android.csproj
├── XamWebApiClient.sln
├── .gitattributes
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | # Xamarin Forms & Web API
2 | This is a Xamarin Forms application that consumes a Web API for CRUD operations.
3 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms.Xaml;
2 |
3 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-hdpi/icon.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/drawable/icon_feed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/drawable/icon_feed.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xhdpi/icon.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xxhdpi/icon.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/drawable/icon_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/drawable/icon_about.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/drawable/xamarin_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/drawable/xamarin_logo.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-hdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-hdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-mdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-mdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techwithpat/XamWebApiClient/HEAD/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
8 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/layout/Toolbar.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Services/IBookService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 | using XamWebApiClient.Models;
4 |
5 | namespace XamWebApiClient.Services
6 | {
7 | public interface IBookService
8 | {
9 | Task> GetBooks();
10 | Task GetBook(int id);
11 | Task AddBook(Book book);
12 | Task SaveBook(Book book);
13 | Task DeleteBook(Book book);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Views/BookDetails.xaml.cs:
--------------------------------------------------------------------------------
1 |
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 | using XamWebApiClient.ViewModels;
5 |
6 | namespace XamWebApiClient.Views
7 | {
8 | [XamlCompilation(XamlCompilationOptions.Compile)]
9 | public partial class BookDetails : ContentPage
10 | {
11 | public BookDetails()
12 | {
13 | InitializeComponent();
14 |
15 | BindingContext = Startup.Resolve();
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/AppShell.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xamarin.Forms;
4 | using XamWebApiClient.ViewModels;
5 | using XamWebApiClient.Views;
6 |
7 | namespace XamWebApiClient
8 | {
9 | public partial class AppShell : Xamarin.Forms.Shell
10 | {
11 | public AppShell()
12 | {
13 | InitializeComponent();
14 |
15 | Routing.RegisterRoute(nameof(AddBook), typeof(AddBook));
16 | Routing.RegisterRoute(nameof(BookDetails), typeof(BookDetails));
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/layout/Tabbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Models/Book.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.Json.Serialization;
5 |
6 | namespace XamWebApiClient.Models
7 | {
8 | public class Book
9 | {
10 | [JsonPropertyName("id")]
11 | public int Id { get; set; }
12 |
13 | [JsonPropertyName("title")]
14 | public string Title { get; set; }
15 |
16 | [JsonPropertyName("author")]
17 | public string Author { get; set; }
18 |
19 | [JsonPropertyName("description")]
20 | public string Description { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Views/AddBook.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Xamarin.Forms;
8 | using Xamarin.Forms.Xaml;
9 | using XamWebApiClient.ViewModels;
10 |
11 | namespace XamWebApiClient.Views
12 | {
13 | [XamlCompilation(XamlCompilationOptions.Compile)]
14 | public partial class AddBook : ContentPage
15 | {
16 | public AddBook()
17 | {
18 | InitializeComponent();
19 |
20 | BindingContext = Startup.Resolve();
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 |
5 | namespace XamWebApiClient
6 | {
7 | public partial class App : Application
8 | {
9 |
10 | public App()
11 | {
12 | InitializeComponent();
13 |
14 | Startup.ConfigureServices();
15 |
16 | MainPage = new AppShell();
17 | }
18 |
19 | protected override void OnStart()
20 | {
21 | }
22 |
23 | protected override void OnSleep()
24 | {
25 | }
26 |
27 | protected override void OnResume()
28 | {
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Views/Books.xaml.cs:
--------------------------------------------------------------------------------
1 |
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 | using XamWebApiClient.ViewModels;
5 |
6 | namespace XamWebApiClient.Views
7 | {
8 | [XamlCompilation(XamlCompilationOptions.Compile)]
9 | public partial class Books : ContentPage
10 | {
11 | private readonly BooksViewModel _booksViewModel;
12 |
13 | public Books()
14 | {
15 | InitializeComponent();
16 |
17 | _booksViewModel = Startup.Resolve();
18 | BindingContext = _booksViewModel;
19 | }
20 |
21 | protected override void OnAppearing()
22 | {
23 | _booksViewModel?.PopulateBooks();
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Views/AddBook.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Views/BookDetails.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using System;
3 | using XamWebApiClient.Services;
4 | using XamWebApiClient.ViewModels;
5 |
6 | namespace XamWebApiClient
7 | {
8 | public static class Startup
9 | {
10 | private static IServiceProvider serviceProvider;
11 | public static void ConfigureServices()
12 | {
13 | var services = new ServiceCollection();
14 |
15 | //add services
16 | services.AddHttpClient(c =>
17 | {
18 | c.BaseAddress = new Uri("http://10.0.2.2:52236/api/");
19 | c.DefaultRequestHeaders.Add("Accept", "application/json");
20 | });
21 |
22 | //add viewmodels
23 | services.AddTransient();
24 | services.AddTransient();
25 | services.AddTransient();
26 |
27 | serviceProvider = services.BuildServiceProvider();
28 | }
29 |
30 | public static T Resolve() => serviceProvider.GetService();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/XamWebApiClient.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | true
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | MSBuild:UpdateDesignTimeXaml
20 |
21 |
22 | MSBuild:UpdateDesignTimeXaml
23 |
24 |
25 | MSBuild:UpdateDesignTimeXaml
26 |
27 |
28 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("XamWebApiClient.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("XamWebApiClient.Android")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | [assembly: AssemblyVersion("1.0.0.0")]
26 | [assembly: AssemblyFileVersion("1.0.0.0")]
27 |
28 | // Add some common permissions, these can be removed if not needed
29 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
30 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
31 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/ViewModels/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Runtime.CompilerServices;
5 |
6 | using Xamarin.Forms;
7 |
8 | namespace XamWebApiClient.ViewModels
9 | {
10 | public class BaseViewModel : INotifyPropertyChanged
11 | {
12 | bool isBusy = false;
13 | public bool IsBusy
14 | {
15 | get { return isBusy; }
16 | set { SetProperty(ref isBusy, value); }
17 | }
18 |
19 | protected bool SetProperty(ref T backingStore, T value,
20 | [CallerMemberName] string propertyName = "",
21 | Action onChanged = null)
22 | {
23 | if (EqualityComparer.Default.Equals(backingStore, value))
24 | return false;
25 |
26 | backingStore = value;
27 | onChanged?.Invoke();
28 | OnPropertyChanged(propertyName);
29 | return true;
30 | }
31 |
32 | #region INotifyPropertyChanged
33 | public event PropertyChangedEventHandler PropertyChanged;
34 | protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
35 | {
36 | var changed = PropertyChanged;
37 | if (changed == null)
38 | return;
39 |
40 | changed.Invoke(this, new PropertyChangedEventArgs(propertyName));
41 | }
42 | #endregion
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/GettingStarted.txt:
--------------------------------------------------------------------------------
1 | Welcome to Xamarin.Forms! Here are some tips to get started building your app.
2 |
3 | Building Your App UI
4 | --------------------
5 |
6 | XAML Hot Reload quickly applies UI changes as you make them to your running app.
7 | This is the most productive way to preview and iteratively create your UI.
8 |
9 | Try it out:
10 |
11 | 1. Run the app by clicking the Start Debugging (play) button in the above toolbar.
12 | 2. Open \Views\AboutPage.xaml.
13 | Don't stop the app - keep it running while making changes.
14 | 3. Change something! Hint: change the Accent color on line 14 from "#96d1ff" to "Pink". Save the file.
15 | 4. Watch the About screen update on the device or emulator, with the logo background now pink.
16 |
17 | Keep going and try more changes!
18 |
19 | QuickStart Guide
20 | ----------------
21 |
22 | Learn more of the fundamentals for building apps with Xamarin here: https://aka.ms/xamarin-quickstart
23 |
24 | Your App Shell
25 | --------------
26 |
27 | This template uses Shell, an app container that reduces the complexity of your apps by providing fundamental features including:
28 |
29 | - A single place to describe the app's visual hierarchy.
30 | - Common navigation such as a flyout menu and tabs.
31 | - A URI-based navigation scheme that permits navigation to any page in the application.
32 | - An integrated search handler.
33 |
34 | Open AppShell.xaml to begin exploring. To learn more about Shell visit: https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/introduction
35 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content.PM;
5 | using Android.Runtime;
6 | using Android.Views;
7 | using Android.Widget;
8 | using Android.OS;
9 |
10 | namespace XamWebApiClient.Droid
11 | {
12 | [Activity(Label = "XamWebApiClient", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
14 | {
15 | protected override void OnCreate(Bundle savedInstanceState)
16 | {
17 | TabLayoutResource = Resource.Layout.Tabbar;
18 | ToolbarResource = Resource.Layout.Toolbar;
19 |
20 | base.OnCreate(savedInstanceState);
21 |
22 | Xamarin.Forms.Forms.SetFlags("SwipeView_Experimental");
23 |
24 | Xamarin.Essentials.Platform.Init(this, savedInstanceState);
25 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
26 | LoadApplication(new App());
27 | }
28 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
29 | {
30 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
31 |
32 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
10 | #2196F3
11 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Services/InMemoryBookService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using XamWebApiClient.Models;
5 |
6 | namespace XamWebApiClient.Services
7 | {
8 | public class InMemoryBookService : IBookService
9 | {
10 | private readonly List _books = new List();
11 | public InMemoryBookService()
12 | {
13 | _books.Add(new Book { Id = 1, Title = "Clean code", Author = "Robert C Martin", Description = "A book about good code" });
14 | _books.Add(new Book { Id = 2, Title = "The pragmatic programmer", Author = "Andy hunt", Description = "All about pragmatism" });
15 | _books.Add(new Book { Id = 3, Title = "Refactoring", Author = "Kent Beck", Description = "Working with legacy code" });
16 | }
17 |
18 | public Task AddBook(Book book)
19 | {
20 | book.Id = ++_books.Last().Id;
21 | _books.Add(book);
22 | return Task.CompletedTask;
23 | }
24 |
25 | public Task DeleteBook(Book book)
26 | {
27 | _books.Remove(book);
28 | return Task.CompletedTask;
29 | }
30 |
31 | public Task GetBook(int id)
32 | {
33 | var book = _books.FirstOrDefault(b => b.Id == id);
34 | return Task.FromResult(book);
35 | }
36 |
37 | public Task> GetBooks()
38 | {
39 | return Task.FromResult( _books.AsEnumerable());
40 | }
41 |
42 | public Task SaveBook(Book book)
43 | {
44 | _books[_books.FindIndex(b => b.Id == book.Id)] = book;
45 | return Task.CompletedTask;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Views/Books.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/AppShell.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
15 |
16 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/XamWebApiClient.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31005.135
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamWebApiClient.Android", "XamWebApiClient\XamWebApiClient.Android\XamWebApiClient.Android.csproj", "{140AAF5F-F1A9-488C-8F6E-D96021F1F5F9}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XamWebApiClient", "XamWebApiClient\XamWebApiClient\XamWebApiClient.csproj", "{189601D4-8FF1-4FE8-B254-D08A15F40B13}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {140AAF5F-F1A9-488C-8F6E-D96021F1F5F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {140AAF5F-F1A9-488C-8F6E-D96021F1F5F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {140AAF5F-F1A9-488C-8F6E-D96021F1F5F9}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
19 | {140AAF5F-F1A9-488C-8F6E-D96021F1F5F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
20 | {140AAF5F-F1A9-488C-8F6E-D96021F1F5F9}.Release|Any CPU.Build.0 = Release|Any CPU
21 | {140AAF5F-F1A9-488C-8F6E-D96021F1F5F9}.Release|Any CPU.Deploy.0 = Release|Any CPU
22 | {189601D4-8FF1-4FE8-B254-D08A15F40B13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {189601D4-8FF1-4FE8-B254-D08A15F40B13}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {189601D4-8FF1-4FE8-B254-D08A15F40B13}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
25 | {189601D4-8FF1-4FE8-B254-D08A15F40B13}.Release|Any CPU.ActiveCfg = Release|Any CPU
26 | {189601D4-8FF1-4FE8-B254-D08A15F40B13}.Release|Any CPU.Build.0 = Release|Any CPU
27 | {189601D4-8FF1-4FE8-B254-D08A15F40B13}.Release|Any CPU.Deploy.0 = Release|Any CPU
28 | EndGlobalSection
29 | GlobalSection(SolutionProperties) = preSolution
30 | HideSolutionNode = FALSE
31 | EndGlobalSection
32 | GlobalSection(ExtensibilityGlobals) = postSolution
33 | SolutionGuid = {1F878717-E383-41D8-ACD8-1E19BBF5B27F}
34 | EndGlobalSection
35 | EndGlobal
36 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/ViewModels/AddBookViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using System.Windows.Input;
4 | using Xamarin.Forms;
5 | using XamWebApiClient.Models;
6 | using XamWebApiClient.Services;
7 |
8 | namespace XamWebApiClient.ViewModels
9 | {
10 | public class AddBookViewModel : BaseViewModel
11 | {
12 | private readonly IBookService _bookService;
13 | private string title;
14 | private string author;
15 | private string description;
16 |
17 | public AddBookViewModel(IBookService bookService)
18 | {
19 | _bookService = bookService;
20 |
21 | SaveBookCommand = new Command(async () => await SaveBook());
22 | }
23 |
24 | private async Task SaveBook()
25 | {
26 | try
27 | {
28 | var book = new Book
29 | {
30 | Title = Title,
31 | Author = Author,
32 | Description = Description
33 | };
34 |
35 | await _bookService.AddBook(book);
36 |
37 | await Shell.Current.GoToAsync("..");
38 | }
39 | catch (Exception ex)
40 | {
41 | Console.WriteLine(ex.Message);
42 | }
43 | }
44 |
45 | public string Title
46 | {
47 | get => title;
48 | set
49 | {
50 | title = value;
51 | OnPropertyChanged(nameof(Title));
52 | }
53 | }
54 | public string Author
55 | {
56 | get => author;
57 | set
58 | {
59 | author = value;
60 | OnPropertyChanged(nameof(Author));
61 | }
62 | }
63 | public string Description
64 | {
65 | get => description;
66 | set
67 | {
68 | description = value;
69 | OnPropertyChanged(nameof(Description));
70 | }
71 | }
72 |
73 | public ICommand SaveBookCommand { get; }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/Services/ApiBookService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Net.Http;
4 | using System.Text;
5 | using System.Text.Json;
6 | using System.Text.Json.Serialization;
7 | using System.Threading.Tasks;
8 | using XamWebApiClient.Models;
9 |
10 | namespace XamWebApiClient.Services
11 | {
12 | public class ApiBookService : IBookService
13 | {
14 | private readonly HttpClient _httpClient;
15 |
16 | public ApiBookService(HttpClient httpClient)
17 | {
18 | _httpClient = httpClient;
19 | }
20 |
21 | public async Task> GetBooks()
22 | {
23 | var response = await _httpClient.GetAsync("Books");
24 |
25 | response.EnsureSuccessStatusCode();
26 |
27 | var responseAsString = await response.Content.ReadAsStringAsync();
28 | return JsonSerializer.Deserialize>(responseAsString);
29 | }
30 |
31 | public async Task GetBook(int id)
32 | {
33 | var response = await _httpClient.GetAsync($"Books/{id}");
34 |
35 | response.EnsureSuccessStatusCode();
36 |
37 | var responseAsString = await response.Content.ReadAsStringAsync();
38 | return JsonSerializer.Deserialize(responseAsString);
39 | }
40 |
41 | public async Task AddBook(Book book)
42 | {
43 | var response = await _httpClient.PostAsync("Books",
44 | new StringContent(JsonSerializer.Serialize(book), Encoding.UTF8, "application/json"));
45 |
46 | response.EnsureSuccessStatusCode();
47 | }
48 |
49 | public async Task DeleteBook(Book book)
50 | {
51 | var response = await _httpClient.DeleteAsync($"Books/{book.Id}");
52 |
53 | response.EnsureSuccessStatusCode();
54 | }
55 |
56 | public async Task SaveBook(Book book)
57 | {
58 | var response = await _httpClient.PutAsync($"Books?id={book.Id}",
59 | new StringContent(JsonSerializer.Serialize(book), Encoding.UTF8, "application/json"));
60 |
61 | response.EnsureSuccessStatusCode();
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/ViewModels/BooksViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 | using System.Threading.Tasks;
4 | using System.Windows.Input;
5 | using Xamarin.Forms;
6 | using XamWebApiClient.Models;
7 | using XamWebApiClient.Services;
8 | using XamWebApiClient.Views;
9 |
10 | namespace XamWebApiClient.ViewModels
11 | {
12 | public class BooksViewModel : BaseViewModel
13 | {
14 | private ObservableCollection books;
15 | private Book selectedBook;
16 | private readonly IBookService _bookService;
17 |
18 | public BooksViewModel(IBookService bookService)
19 | {
20 | _bookService = bookService;
21 |
22 | Books = new ObservableCollection();
23 |
24 | DeleteBookCommand = new Command(async b => await DeleteBook(b));
25 |
26 | AddNewBookCommand = new Command(async () => await GoToAddbookView());
27 | }
28 |
29 | private async Task DeleteBook(Book b)
30 | {
31 | await _bookService.DeleteBook(b);
32 |
33 | PopulateBooks();
34 | }
35 |
36 | private async Task GoToAddbookView()
37 | => await Shell.Current.GoToAsync(nameof(AddBook));
38 |
39 | public async void PopulateBooks()
40 | {
41 | try
42 | {
43 | Books.Clear();
44 |
45 | var books = await _bookService.GetBooks();
46 | foreach (var book in books)
47 | {
48 | Books.Add(book);
49 | }
50 | }
51 | catch (Exception ex)
52 | {
53 | Console.WriteLine(ex.Message);
54 | }
55 | }
56 |
57 | async void OnBookSelected(Book book)
58 | {
59 | if (book == null)
60 | return;
61 |
62 | await Shell.Current.GoToAsync($"{nameof(BookDetails)}?{nameof(BookDetailsViewModel.BookId)}={book.Id}");
63 | }
64 |
65 | public ObservableCollection Books
66 | {
67 | get => books;
68 | set
69 | {
70 | books = value;
71 | OnPropertyChanged(nameof(Books));
72 | }
73 | }
74 |
75 | public Book SelectedBook
76 | {
77 | get => selectedBook;
78 | set
79 | {
80 | if(selectedBook != value)
81 | {
82 | selectedBook = value;
83 |
84 | OnBookSelected(SelectedBook);
85 | }
86 | }
87 | }
88 |
89 | public ICommand DeleteBookCommand { get; }
90 |
91 | public ICommand AddNewBookCommand { get; }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient/ViewModels/BookDetailsViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using System.Windows.Input;
4 | using Xamarin.Forms;
5 | using XamWebApiClient.Models;
6 | using XamWebApiClient.Services;
7 |
8 | namespace XamWebApiClient.ViewModels
9 | {
10 | [QueryProperty(nameof(BookId), nameof(BookId))]
11 | public class BookDetailsViewModel : BaseViewModel
12 | {
13 | private string bookId;
14 | private string title;
15 | private string author;
16 | private string description;
17 | private readonly IBookService _bookService;
18 |
19 | public BookDetailsViewModel(IBookService bookService)
20 | {
21 | _bookService = bookService;
22 |
23 | SaveBookCommand = new Command(async () => await SaveBook());
24 | }
25 |
26 | private async Task SaveBook()
27 | {
28 | try
29 | {
30 | var book = new Book
31 | {
32 | Id = int.Parse(BookId),
33 | Title = Title,
34 | Author = Author,
35 | Description = Description
36 | };
37 |
38 | await _bookService.SaveBook(book);
39 |
40 | await Shell.Current.GoToAsync("..");
41 | }
42 | catch (Exception ex)
43 | {
44 | Console.WriteLine(ex.Message);
45 | }
46 | }
47 |
48 | private async void LoadBook(string bookId)
49 | {
50 | try
51 | {
52 | var book = await _bookService.GetBook(int.Parse(bookId));
53 | if(bookId != null)
54 | {
55 | Title = book.Title;
56 | Author = book.Author;
57 | Description = book.Description;
58 | }
59 | }
60 | catch (Exception ex)
61 | {
62 | Console.WriteLine(ex.Message);
63 | }
64 | }
65 |
66 | public string BookId
67 | {
68 | get => bookId;
69 | set
70 | {
71 | bookId = value;
72 | LoadBook(bookId);
73 | }
74 | }
75 |
76 | public string Title
77 | {
78 | get => title;
79 | set
80 | {
81 | title = value;
82 | OnPropertyChanged(nameof(Title));
83 | }
84 | }
85 | public string Author
86 | {
87 | get => author;
88 | set
89 | {
90 | author = value;
91 | OnPropertyChanged(nameof(Author));
92 | }
93 | }
94 | public string Description
95 | {
96 | get => description;
97 | set
98 | {
99 | description = value;
100 | OnPropertyChanged(nameof(Description));
101 | }
102 | }
103 |
104 | public ICommand SaveBookCommand { get; }
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/XamWebApiClient/XamWebApiClient.Android/XamWebApiClient.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {140AAF5F-F1A9-488C-8F6E-D96021F1F5F9}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | {6968b3a4-1835-46a3-ac5c-1ae33b475983}
9 | Library
10 | XamWebApiClient.Droid
11 | XamWebApiClient.Android
12 | True
13 | True
14 | Resources\Resource.designer.cs
15 | Resource
16 | Properties\AndroidManifest.xml
17 | Resources
18 | Assets
19 | false
20 | v9.0
21 | true
22 | true
23 | Xamarin.Android.Net.AndroidClientHandler
24 |
25 |
26 |
27 |
28 | true
29 | portable
30 | false
31 | bin\Debug
32 | DEBUG;
33 | prompt
34 | 4
35 | None
36 |
37 |
38 | true
39 | portable
40 | true
41 | bin\Release
42 | prompt
43 | 4
44 | true
45 | false
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | {E92B09C8-05E0-4151-83B5-5CA44689574A}
94 | XamWebApiClient
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | [Aa][Rr][Mm]/
24 | [Aa][Rr][Mm]64/
25 | bld/
26 | [Bb]in/
27 | [Oo]bj/
28 | [Ll]og/
29 |
30 | # Visual Studio 2015/2017 cache/options directory
31 | .vs/
32 | # Uncomment if you have tasks that create the project's static files in wwwroot
33 | #wwwroot/
34 |
35 | # Visual Studio 2017 auto generated files
36 | Generated\ Files/
37 |
38 | # MSTest test Results
39 | [Tt]est[Rr]esult*/
40 | [Bb]uild[Ll]og.*
41 |
42 | # NUNIT
43 | *.VisualState.xml
44 | TestResult.xml
45 |
46 | # Build Results of an ATL Project
47 | [Dd]ebugPS/
48 | [Rr]eleasePS/
49 | dlldata.c
50 |
51 | # Benchmark Results
52 | BenchmarkDotNet.Artifacts/
53 |
54 | # .NET Core
55 | project.lock.json
56 | project.fragment.lock.json
57 | artifacts/
58 |
59 | # StyleCop
60 | StyleCopReport.xml
61 |
62 | # Files built by Visual Studio
63 | *_i.c
64 | *_p.c
65 | *_h.h
66 | *.ilk
67 | *.meta
68 | *.obj
69 | *.iobj
70 | *.pch
71 | *.pdb
72 | *.ipdb
73 | *.pgc
74 | *.pgd
75 | *.rsp
76 | *.sbr
77 | *.tlb
78 | *.tli
79 | *.tlh
80 | *.tmp
81 | *.tmp_proj
82 | *_wpftmp.csproj
83 | *.log
84 | *.vspscc
85 | *.vssscc
86 | .builds
87 | *.pidb
88 | *.svclog
89 | *.scc
90 |
91 | # Chutzpah Test files
92 | _Chutzpah*
93 |
94 | # Visual C++ cache files
95 | ipch/
96 | *.aps
97 | *.ncb
98 | *.opendb
99 | *.opensdf
100 | *.sdf
101 | *.cachefile
102 | *.VC.db
103 | *.VC.VC.opendb
104 |
105 | # Visual Studio profiler
106 | *.psess
107 | *.vsp
108 | *.vspx
109 | *.sap
110 |
111 | # Visual Studio Trace Files
112 | *.e2e
113 |
114 | # TFS 2012 Local Workspace
115 | $tf/
116 |
117 | # Guidance Automation Toolkit
118 | *.gpState
119 |
120 | # ReSharper is a .NET coding add-in
121 | _ReSharper*/
122 | *.[Rr]e[Ss]harper
123 | *.DotSettings.user
124 |
125 | # JustCode is a .NET coding add-in
126 | .JustCode
127 |
128 | # TeamCity is a build add-in
129 | _TeamCity*
130 |
131 | # DotCover is a Code Coverage Tool
132 | *.dotCover
133 |
134 | # AxoCover is a Code Coverage Tool
135 | .axoCover/*
136 | !.axoCover/settings.json
137 |
138 | # Visual Studio code coverage results
139 | *.coverage
140 | *.coveragexml
141 |
142 | # NCrunch
143 | _NCrunch_*
144 | .*crunch*.local.xml
145 | nCrunchTemp_*
146 |
147 | # MightyMoose
148 | *.mm.*
149 | AutoTest.Net/
150 |
151 | # Web workbench (sass)
152 | .sass-cache/
153 |
154 | # Installshield output folder
155 | [Ee]xpress/
156 |
157 | # DocProject is a documentation generator add-in
158 | DocProject/buildhelp/
159 | DocProject/Help/*.HxT
160 | DocProject/Help/*.HxC
161 | DocProject/Help/*.hhc
162 | DocProject/Help/*.hhk
163 | DocProject/Help/*.hhp
164 | DocProject/Help/Html2
165 | DocProject/Help/html
166 |
167 | # Click-Once directory
168 | publish/
169 |
170 | # Publish Web Output
171 | *.[Pp]ublish.xml
172 | *.azurePubxml
173 | # Note: Comment the next line if you want to checkin your web deploy settings,
174 | # but database connection strings (with potential passwords) will be unencrypted
175 | *.pubxml
176 | *.publishproj
177 |
178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
179 | # checkin your Azure Web App publish settings, but sensitive information contained
180 | # in these scripts will be unencrypted
181 | PublishScripts/
182 |
183 | # NuGet Packages
184 | *.nupkg
185 | # The packages folder can be ignored because of Package Restore
186 | **/[Pp]ackages/*
187 | # except build/, which is used as an MSBuild target.
188 | !**/[Pp]ackages/build/
189 | # Uncomment if necessary however generally it will be regenerated when needed
190 | #!**/[Pp]ackages/repositories.config
191 | # NuGet v3's project.json files produces more ignorable files
192 | *.nuget.props
193 | *.nuget.targets
194 |
195 | # Microsoft Azure Build Output
196 | csx/
197 | *.build.csdef
198 |
199 | # Microsoft Azure Emulator
200 | ecf/
201 | rcf/
202 |
203 | # Windows Store app package directories and files
204 | AppPackages/
205 | BundleArtifacts/
206 | Package.StoreAssociation.xml
207 | _pkginfo.txt
208 | *.appx
209 |
210 | # Visual Studio cache files
211 | # files ending in .cache can be ignored
212 | *.[Cc]ache
213 | # but keep track of directories ending in .cache
214 | !?*.[Cc]ache/
215 |
216 | # Others
217 | ClientBin/
218 | ~$*
219 | *~
220 | *.dbmdl
221 | *.dbproj.schemaview
222 | *.jfm
223 | *.pfx
224 | *.publishsettings
225 | orleans.codegen.cs
226 |
227 | # Including strong name files can present a security risk
228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
229 | #*.snk
230 |
231 | # Since there are multiple workflows, uncomment next line to ignore bower_components
232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
233 | #bower_components/
234 |
235 | # RIA/Silverlight projects
236 | Generated_Code/
237 |
238 | # Backup & report files from converting an old project file
239 | # to a newer Visual Studio version. Backup files are not needed,
240 | # because we have git ;-)
241 | _UpgradeReport_Files/
242 | Backup*/
243 | UpgradeLog*.XML
244 | UpgradeLog*.htm
245 | ServiceFabricBackup/
246 | *.rptproj.bak
247 |
248 | # SQL Server files
249 | *.mdf
250 | *.ldf
251 | *.ndf
252 |
253 | # Business Intelligence projects
254 | *.rdl.data
255 | *.bim.layout
256 | *.bim_*.settings
257 | *.rptproj.rsuser
258 | *- Backup*.rdl
259 |
260 | # Microsoft Fakes
261 | FakesAssemblies/
262 |
263 | # GhostDoc plugin setting file
264 | *.GhostDoc.xml
265 |
266 | # Node.js Tools for Visual Studio
267 | .ntvs_analysis.dat
268 | node_modules/
269 |
270 | # Visual Studio 6 build log
271 | *.plg
272 |
273 | # Visual Studio 6 workspace options file
274 | *.opt
275 |
276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
277 | *.vbw
278 |
279 | # Visual Studio LightSwitch build output
280 | **/*.HTMLClient/GeneratedArtifacts
281 | **/*.DesktopClient/GeneratedArtifacts
282 | **/*.DesktopClient/ModelManifest.xml
283 | **/*.Server/GeneratedArtifacts
284 | **/*.Server/ModelManifest.xml
285 | _Pvt_Extensions
286 |
287 | # Paket dependency manager
288 | .paket/paket.exe
289 | paket-files/
290 |
291 | # FAKE - F# Make
292 | .fake/
293 |
294 | # JetBrains Rider
295 | .idea/
296 | *.sln.iml
297 |
298 | # CodeRush personal settings
299 | .cr/personal
300 |
301 | # Python Tools for Visual Studio (PTVS)
302 | __pycache__/
303 | *.pyc
304 |
305 | # Cake - Uncomment if you are using it
306 | # tools/**
307 | # !tools/packages.config
308 |
309 | # Tabs Studio
310 | *.tss
311 |
312 | # Telerik's JustMock configuration file
313 | *.jmconfig
314 |
315 | # BizTalk build output
316 | *.btp.cs
317 | *.btm.cs
318 | *.odx.cs
319 | *.xsd.cs
320 |
321 | # OpenCover UI analysis results
322 | OpenCover/
323 |
324 | # Azure Stream Analytics local run output
325 | ASALocalRun/
326 |
327 | # MSBuild Binary and Structured Log
328 | *.binlog
329 |
330 | # NVidia Nsight GPU debugger configuration file
331 | *.nvuser
332 |
333 | # MFractors (Xamarin productivity tool) working folder
334 | .mfractor/
335 |
336 | # Local History for Visual Studio
337 | .localhistory/
338 |
339 | # BeatPulse healthcheck temp database
340 | healthchecksdb
--------------------------------------------------------------------------------