Skip to content
Miguel Gamboa edited this page Jun 9, 2021 · 10 revisions

Create a private repo in Github for your AVE homework with a distinct folder per workout. Add your teacher username as collaborator of your github repo (fmcarvalho or lfalcao-isel).

  1. Install last release of .NET SDK from https://dotnet.microsoft.com/download

  2. Implement a managed version of aula02-unmanaged-static-link with dotnet:

    • PointLib folder - contains the equivalent to Point.kt in csharp Point.cs:
      • run dotnet new classlib
      • replace class Class1.cs by aforementioned Point.cs
      • run dotnet build
      • run dotnet publish
    • PointApp folder - Contains the equivalent to App.java in csharp Program.cs:
      • run dotnet new console
      • run dotnet run and check the output
      • modify Program.cs to implement the same behavior of App.java
      • NOTICE you need a reference to point.dll:
        1. copy and paste point.dll from publish folder of PointLib
        2. Add a reference to point.dll in .csproj file such as:
  <ItemGroup>
    <Reference Include="point">
      <HintPath>point.dll</HintPath>
    </Reference>
  </ItemGroup>
  1. Check the need of point.dll in compile and run time of App.

Create a dotnet console application that prints the names of all types and their methods names contained in RestSharp.dll of aula03-reflection, such as:

IAuthenticator
     Authenticate
HttpBasicAuthenticator
     Authenticate
     GetType
     ToString
     Equals
     GetHashCode
NtlmAuthenticator
     Authenticate
     GetType
     ...

Modify the Logger.Log from lesson 5 to present only information of members annotated with ToLog custom attribute.

Modify the Logger.Log from lesson 6 to present the label annotated in ToLog custom attribute (if exists).

Implement a simple naïf Program.cs that read all documents from a Collection in a Firestore database following the steps described in isel-AVE-2021-FireStore-get-started.md.

Refactor project to include a new interface that specifies the way of dealing with properties, regardless their kind. This interface must have distinct implementations depending on whether it deals with complex properties (other domain types) or primitive (and string) properties.

Write in C# the equivalent program to the IL definition of methods Foo and gcd of files App1.il and App2.il of folder aula15-il-exercises.

Generate a new method int MyMethod(MyDynamicType other) on MyDynamicType of lesson 16 that multiplies the values of fields m_number between this and other. The following sample should produce the result 63 on output.

object obj = Activator.CreateInstance(dynType, new object[]{7});
object other = Activator.CreateInstance(dynType, new object[]{9});
object res2 = dynType
    .GetMethod("MyMethod", new Type[]{ dynType }) // Get the MethodInfo of MyMethod
    .Invoke(obj, new object[]{other});            // Invoke that MethodInfo
Console.WriteLine("new MyDynamicType(7).MyMethod(new MyDynamicType(9)) --> " + res2);

The Distinct returns a new Sequence (still eager) without repetitions (unique elements).

For example, the execution of aula34 should print:

David
Diogo
Douglas
Clone this wiki locally